zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

Don't support nested mutation? #1137

Closed mozomig closed 2 years ago

mozomig commented 2 years ago

Hello, how i can make nested mutation?

I have correct mutation in hasura

 mutation CreateProject($user_id: uuid, $name: String) {
  insert_projects_one(object: {name: $name, projects_users: {data: {user_id: $user_id}}}) {
    id
    name
    created_at
    avatar
  }
}

he's work perfectly in web ui hasura, but i try run this mutation in flutter with graphql library, i take this error

OperationException(linkException: null, graphqlErrors: [GraphQLError(message: field "projects_users" not found in type: 'projects_insert_input', locations: null, path: null, extensions: {path: $.selectionSet.insert_projects_one.args.object.projects_users, code: validation-failed})])
budde377 commented 2 years ago

@mozomig take a look at your error message:

field "projects_users" not found in type: 'projects_insert_input',

This is an error from your server meaning that your input is invalid. As the error message states, you don't have a projects_users field on the input.