I'm following a tutorial (here:https://www.howtographql.com/graphql-js/5-authentication/) on graphql and came across a mutation with nested inputs. How would I write the corresponding graphql-tag?
gql``
Schema:
type Mutation {
createUser(name: String!, authProvider: AuthProviderSignupData!): User
}
###########
## Inputs
###########
input AuthProviderEmail {
email: String!
password: String!
}
input AuthProviderSignupData {
email: AuthProviderEmail
}
Corresponding graphiql input:
mutation CreateUser {
createUser(name: "tester2", authProvider: {email: {email: "test@test.com", password: "password"}}) {
id
name
}
}
const mutation = gql`
mutation createUser($authProvider: AuthProviderSignupData!, $name: String!) {
createUser(authProvider: $authProvider, name: $name) {
id
}
}
`
const variables = {
"authProvider": {
"email": {
"email": "chakri@example.com",
"password": "123456789"
}
},
"name": "chakri",
}