How to write query of mutation for complex schema

Hello Sebastian,

I am having trouble doing a mutation for this type of schema

mutation {
  createUserUsedProductsContent(
    data: {email: {iv: "rahiyansafin@gmail.com"}, items: {iv: [{productId: 123}, {productId: 123}]}}
    publish: true
  ) {
    id
    flatData {
      email
      items {
        productId
      }
    }
  }
}

it’s working fine when i am doing it through squidex graphql manually.

but having issue in code.

if i show you a picture of the query i wrote you’ll understand

and then i am having

error - Error: Variable ‘items’ cannot be non-input type ‘ProductInput’.
Unknown type ProductInput. Did you mean ‘ProductType’, ‘Product’, ‘ProductDataDto’, ‘ProductRating’, or ‘ProductFeature’?
Variable ‘$items’ is invalid. Variable has unknown type ‘ProductInput’

this error.

could you help me correcting my query please?

@Sebastian hey, waiting for your response sebastian

Timezones sucks :wink:

I am pretty sure, you cannot really build your own schema in the client. So you have to use a preexisting type from the graphql spec. You can look up the name in the generated graphql spec.

1 Like

could you kindly please share me something that could help?

been suffering on this for like 3 days. about to give up