我正在学习有关 graphql 的教程(此处:https : //www.howtographql.com/graphql-js/5-authentication/),并遇到了带有嵌套输入的突变。我将如何编写相应的 graphql-tag?
gql``
架构:
type Mutation {
createUser(name: String!, authProvider: AuthProviderSignupData!): User
}
###########
## Inputs
###########
input AuthProviderEmail {
email: String!
password: String!
}
input AuthProviderSignupData {
email: AuthProviderEmail
}
对应的graphiql输入:
mutation CreateUser {
createUser(name: "tester2", authProvider: {email: {email: "test@test.com", password: "password"}}) {
id
name
}
}