Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danieladarve/55038314f896172a4d9898d5778469d7 to your computer and use it in GitHub Desktop.
Save danieladarve/55038314f896172a4d9898d5778469d7 to your computer and use it in GitHub Desktop.
Custom Fragment for CraftCMS Formie
query NODE_Form($id: [QueryArgument], $siteId: [QueryArgument]) {
formieForm(id: $id, siteId: $siteId) {
remoteTypeName: __typename
..._CraftFormID_
...Form
}
}
query LIST_Form($limit: Int, $offset: Int) {
formieForms(limit: $limit, offset: $offset, site: "default") {
remoteTypeName: __typename
..._CraftFormID_
...Form
}
}
fragment _CraftFormID_ on Form {
remoteTypeName: __typename
remoteId: id
siteId
}
fragment OptionValues on KeyValueType {
label
value
isDefault
}
fragment FormFields on FieldInterface {
remoteTypeName: __typename
... on Field_Address {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
autocompleteIntegration
autocompleteEnabled
autocompleteCollapsed
autocompleteLabel
autocompletePlaceholder
autocompleteDefaultValue
autocompletePrePopulate
autocompleteRequired
autocompleteErrorMessage
address1Enabled
address1Collapsed
address1Label
address1Placeholder
address1DefaultValue
address1PrePopulate
address1Required
address1ErrorMessage
address1Hidden
address2Enabled
address2Collapsed
address2Label
address2Placeholder
address2DefaultValue
address2PrePopulate
address2Required
address2ErrorMessage
address2Hidden
address3Enabled
address3Collapsed
address3Label
address3Placeholder
address3DefaultValue
address3PrePopulate
address3Required
address3ErrorMessage
address3Hidden
cityEnabled
cityCollapsed
cityLabel
cityPlaceholder
cityDefaultValue
cityPrePopulate
cityRequired
cityErrorMessage
cityHidden
stateEnabled
stateCollapsed
stateLabel
statePlaceholder
stateDefaultValue
statePrePopulate
stateRequired
stateErrorMessage
stateHidden
zipEnabled
zipCollapsed
zipLabel
zipPlaceholder
zipDefaultValue
zipPrePopulate
zipRequired
zipErrorMessage
zipHidden
countryEnabled
countryCollapsed
countryLabel
countryPlaceholder
countryDefaultValue
countryPrePopulate
countryRequired
countryErrorMessage
countryHidden
enableAutocomplete
subfieldLabelPosition
defaultValue
prePopulate
formId
isNested
}
... on Field_Agree {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
description
checkedValue
uncheckedValue
defaultState
prePopulate
formId
isNested
descriptionHtml
}
... on Field_Categories {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
searchable
allowLimit
allowMultipleSources
branchLimit
defaultValue
prePopulate
formId
isNested
displayType
labelSource
sources
source
targetSiteId
viewMode
selectionLabel
showSiteMenu
localizeRelations
validateRelatedElements
allowSelfRelations
}
... on Field_Checkboxes {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
multi
layout
options {
remoteTypeName: __typename
... on KeyValueType {
... OptionValues
}
}
defaultValue
prePopulate
formId
isNested
}
... on Field_Date {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
dateFormat
timeFormat
displayType
includeTime
timeLabel
defaultOption
dayLabel
dayPlaceholder
monthLabel
monthPlaceholder
yearLabel
yearPlaceholder
hourLabel
hourPlaceholder
minuteLabel
minutePlaceholder
secondLabel
secondPlaceholder
ampmLabel
ampmPlaceholder
subfieldLabelPosition
defaultDate
prePopulate
formId
isNested
}
... on Field_Dropdown {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
multiple
multi
optgroups
options {
remoteTypeName: __typename
... on KeyValueType {
... OptionValues
}
}
defaultValue
prePopulate
formId
isNested
}
... on Field_Email {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
defaultValue
prePopulate
formId
isNested
}
... on Field_Entries {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
searchable
defaultValue
prePopulate
formId
isNested
displayType
labelSource
sources
source
targetSiteId
viewMode
selectionLabel
showSiteMenu
localizeRelations
validateRelatedElements
allowSelfRelations
}
... on Field_FileUpload {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
searchable
sizeLimit
limitFiles
restrictFiles
allowedKinds
uploadLocationSource
uploadLocationSubpath
useSingleFolder
allowUploads
defaultUploadLocationSource
defaultUploadLocationSubpath
singleUploadLocationSource
singleUploadLocationSubpath
showUnpermittedVolumes
showUnpermittedFiles
previewMode
defaultValue
prePopulate
formId
isNested
displayType
labelSource
sources
source
targetSiteId
viewMode
selectionLabel
showSiteMenu
localizeRelations
validateRelatedElements
allowSelfRelations
}
... on Field_Group {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
contentTable
defaultValue
prePopulate
formId
isNested
nestedRows {
remoteTypeName: __typename
}
fields {
remoteTypeName: __typename
}
}
... on Field_Heading {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
headingSize
defaultValue
prePopulate
formId
isNested
}
... on Field_Hidden {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
defaultOption
queryParameter
defaultValue
prePopulate
formId
isNested
}
... on Field_Html {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
htmlContent
defaultValue
prePopulate
formId
isNested
}
... on Field_MissingField {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
expectedType
settings
defaultValue
prePopulate
formId
isNested
}
... on Field_MultiLineText {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
useRichText
richTextButtons
defaultValue
prePopulate
formId
isNested
}
... on Field_Name {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
useMultipleFields
prefixEnabled
prefixCollapsed
prefixLabel
prefixPlaceholder
prefixDefaultValue
prefixPrePopulate
prefixRequired
prefixErrorMessage
firstNameEnabled
firstNameCollapsed
firstNameLabel
firstNamePlaceholder
firstNameDefaultValue
firstNamePrePopulate
firstNameRequired
firstNameErrorMessage
middleNameEnabled
middleNameCollapsed
middleNameLabel
middleNamePlaceholder
middleNameDefaultValue
middleNamePrePopulate
middleNameRequired
middleNameErrorMessage
lastNameEnabled
lastNameCollapsed
lastNameLabel
lastNamePlaceholder
lastNameDefaultValue
lastNamePrePopulate
lastNameRequired
lastNameErrorMessage
subfieldLabelPosition
defaultValue
prePopulate
formId
isNested
}
... on Field_Number {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
min
max
decimals
defaultValue
prePopulate
formId
isNested
}
... on Field_Phone {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
countryEnabled
countryCollapsed
countryShowDialCode
countryDefaultValue
countryAllowed
subfieldLabelPosition
defaultValue
prePopulate
formId
isNested
}
... on Field_Radio {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
layout
options {
remoteTypeName: __typename
... on KeyValueType {
... OptionValues
}
}
defaultValue
prePopulate
formId
isNested
}
... on Field_Recipients {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
displayType
options {
remoteTypeName: __typename
... on KeyValueType {
... OptionValues
}
}
multiple
defaultValue
prePopulate
formId
isNested
}
... on Field_Section {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
borderStyle
borderWidth
borderColor
defaultValue
prePopulate
formId
isNested
}
... on Field_SingleLineText {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
defaultValue
prePopulate
formId
isNested
}
... on Field_Table {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
searchable
columns {
remoteTypeName: __typename
... on KeyValueType {
... OptionValues
}
}
static
addRowLabel
maxRows
minRows
defaults {
remoteTypeName: __typename
... on KeyValueType {
... OptionValues
}
}
columnType
defaultValue
prePopulate
formId
isNested
}
... on Field_Tags {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
searchable
allowMultipleSources
allowLimit
defaultValue
prePopulate
formId
isNested
displayType
labelSource
sources
source
targetSiteId
viewMode
selectionLabel
showSiteMenu
localizeRelations
validateRelatedElements
allowSelfRelations
}
... on Field_Users {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
searchable
defaultValue
prePopulate
formId
isNested
displayType
labelSource
sources
source
targetSiteId
viewMode
selectionLabel
showSiteMenu
localizeRelations
validateRelatedElements
allowSelfRelations
}
}
fragment RepeaterField on FieldInterface {
... on Field_Repeater {
id
uid
name
handle
instructions
required
type
displayName
columnWidth
limit
limitType
limitAmount
placeholder
errorMessage
labelPosition
instructionsPosition
cssClasses
containerAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
inputAttributes {
remoteTypeName: __typename
... on FieldAttribute {
label
value
}
}
minRows
maxRows
addLabel
contentTable
defaultValue
prePopulate
formId
isNested
nestedRows {
... on RowType {
id
uid
fields {
remoteTypeName: __typename
... FormFields
}
}
}
fields {
remoteTypeName: __typename
... FormFields
}
}
}
fragment RowFields on RowType {
id
uid
fields {
remoteTypeName: __typename
... FormFields
... RepeaterField
}
}
fragment Form on Form {
remoteId: id
uid
title
slug
uri
enabled
archived
siteId
language
searchScore
trashed
status
dateCreated
dateUpdated
handle
pages {
remoteTypeName: __typename
... on PageType {
id
uid
name
rows {
remoteTypeName: __typename
... RowFields
}
fields {
remoteTypeName: __typename
... FormFields
... RepeaterField
}
settings {
remoteTypeName: __typename
... on PageSettingsType {
id
uid
submitButtonLabel
backButtonLabel
showBackButton
buttonsPosition
}
}
}
}
rows {
remoteTypeName: __typename
... RowFields
}
remoteFields: fields {
remoteTypeName: __typename
... FormFields
... RepeaterField
}
settings {
remoteTypeName: __typename
... on FormSettingsType {
displayFormTitle
displayPageTabs
displayCurrentPageTitle
displayPageProgress
submitMethod
submitAction
submitActionTab
submitActionUrl
submitActionFormHide
submitActionMessageHtml
submitActionMessageTimeout
errorMessageHtml
loadingIndicator
loadingIndicatorText
validationOnSubmit
validationOnFocus
defaultLabelPosition
defaultInstructionsPosition
progressPosition
}
}
configJson
templateHtml
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment