i am new in GraphQL, i didn't get how to debug this issue
this is my grphql schema
input AccommodationInput {
id: ID @globalId(decode: ID)
"The name of the Accommodation."
name: [I18nDescription!]
"The status of the Accommodation."
"The Meta of the Accommodation"
meta: [AccommodationMeta!]
}
extend type Mutation @guard @namespace(field: "App\\GraphQL\\Accommodation\\Mutations") {
"Create an Accommodation."
accommodationCreate(input: AccommodationInput!): AccommodationCreatePayload
@field(resolver: "AccommodationCreateMutation")
}
When i sync schema in frontend, it's throwing an error
[email protected] download-schema node scripts/downloadSchema.mjs
Error: Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: undefined.
when i define AccommodationPictureMeta
type and new error is comming
type AccommodationPictureMeta {
id: ID!
"The Upload picture custom alt value."
alt: String!
}
[email protected] download-schema node scripts/downloadSchema.mjs
Error: Introspection must provide input type for arguments, but received: [AccommodationPictureMeta].
can you please help me to debug and resolve this issue.
CodePudding user response:
According to GraphQL Specification:
A GraphQL Input Object defines a set of input fields; the input fields are either scalars, enums, or other input objects.
In short, your meta
field in AccommodationInput
should be itself an input (eg. AccommodationMetaInput
)