Skip to content

GraphQL

To query forms, edit your GraphQL schema under GraphQL → Schemas and tick Query Basin forms in the Basin section.

Submissions aren’t available through GraphQL, because they contain personal data and GraphQL APIs are often public.

{
basinForms {
uuid
name
action
}
basinForm(uuid: "demo00quotes") {
name
action
isStudioForm
studioScriptUrl
spamProtection {
captcha
siteKey
scriptUrl
recaptchaVersion
honeypotField
}
}
}

basinForm returns null for a form that isn’t in the linked project, and the Control Panel warns you.

A Basin Form field returns a BasinForm, or null:

{
entries(section: "pages") {
... on page_Entry {
contactForm {
uuid
action
}
}
}
}

This works whether or not the schema has Query Basin forms, because the form is part of the entry.

Field Type
uuid String! The Basin ID.
name String!
action String! The endpoint URL to post to.
useAjax Boolean! Whether Basin’s Enable AJAX setting is on, so the form always responds with JSON.
redirectUrl String Where Basin sends visitors after submitting.
isStudioForm Boolean! Whether a Form Studio embed code is saved.
studioScriptUrl String The Form Studio embed script. Add it as <script src="…" async> where the form should appear.
spamProtection BasinSpamProtection! What the page must include for Basin to accept submissions.
Field Type
captcha String recaptcha, hcaptcha, turnstile, or null.
siteKey String The site key to render the CAPTCHA with.
scriptUrl String The CAPTCHA provider’s script.
recaptchaVersion String v3 or v2, for reCAPTCHA.
honeypotField String! The name of the hidden honeypot input. Leave it empty.
  • Honeypot: a text input named honeypotField, hidden from people (e.g. style="display:none", tabindex="-1", autocomplete="off"), left empty.
  • reCAPTCHA v3: when the form is submitted, get a token with grecaptcha.execute(siteKey, { action: 'submit' }) and send it as g-recaptcha-response, plus g-recaptcha-version set to v3. scriptUrl already includes ?render={siteKey}.
  • reCAPTCHA v2, hCaptcha, Turnstile: load scriptUrl and render the provider’s widget with siteKey inside the form. The widget adds its own response field.