We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`router.AddMutationField("test_union", types.IdType, graphql.FieldConfigArgument{ "input": &graphql.ArgumentConfig{ Type: graphql.NewList(searchInputType), }, }, UpdateSetting)
type Book struct { Title string json:"title" Author string json:"author" }
json:"title"
json:"author"
type Movie struct { Title string json:"title" Director string json:"director" }
json:"director"
var bookType = graphql.NewObject( graphql.ObjectConfig{ Name: "Book", Fields: graphql.Fields{ "title": &graphql.Field{ Type: graphql.String, }, "author": &graphql.Field{ Type: graphql.String, }, "__typename": &graphql.Field{ Type: graphql.String, }, }, }, )
var movieType = graphql.NewObject( graphql.ObjectConfig{ Name: "Movie", Fields: graphql.Fields{ "title": &graphql.Field{ Type: graphql.String, }, "director": &graphql.Field{ Type: graphql.String, }, "__typename": &graphql.Field{ Type: graphql.String, }, }, }, )
var productUnion = graphql.NewUnion(graphql.UnionConfig{ Name: "Product", Types: []*graphql.Object{ bookType, movieType, }, ResolveType: func(p graphql.ResolveTypeParams) *graphql.Object { switch p.Value.(type) { case Book: return bookType case Movie: return movieType default: return movieType } }, })
var searchInputType = graphql.NewInputObject(graphql.InputObjectConfig{ Name: "SearchInput", Fields: graphql.InputObjectConfigFieldMap{ "product": &graphql.InputObjectFieldConfig{ Type: graphql.NewList(productUnion), }, "__typename": &graphql.InputObjectFieldConfig{ Type: graphql.String, }, }, }) `
when make this get Error: Introspection must provide input type for arguments.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`router.AddMutationField("test_union", types.IdType, graphql.FieldConfigArgument{
"input": &graphql.ArgumentConfig{
Type: graphql.NewList(searchInputType),
},
}, UpdateSetting)
type Book struct {
Title string
json:"title"
Author string
json:"author"
}
type Movie struct {
Title string
json:"title"
Director string
json:"director"
}
var bookType = graphql.NewObject(
graphql.ObjectConfig{
Name: "Book",
Fields: graphql.Fields{
"title": &graphql.Field{
Type: graphql.String,
},
"author": &graphql.Field{
Type: graphql.String,
},
"__typename": &graphql.Field{
Type: graphql.String,
},
},
},
)
var movieType = graphql.NewObject(
graphql.ObjectConfig{
Name: "Movie",
Fields: graphql.Fields{
"title": &graphql.Field{
Type: graphql.String,
},
"director": &graphql.Field{
Type: graphql.String,
}, "__typename": &graphql.Field{
Type: graphql.String,
},
},
},
)
var productUnion = graphql.NewUnion(graphql.UnionConfig{
Name: "Product",
Types: []*graphql.Object{
bookType, movieType,
},
ResolveType: func(p graphql.ResolveTypeParams) *graphql.Object {
switch p.Value.(type) {
case Book:
return bookType
case Movie:
return movieType
default:
return movieType
}
},
})
var searchInputType = graphql.NewInputObject(graphql.InputObjectConfig{
Name: "SearchInput",
Fields: graphql.InputObjectConfigFieldMap{
"product": &graphql.InputObjectFieldConfig{
Type: graphql.NewList(productUnion),
}, "__typename": &graphql.InputObjectFieldConfig{
Type: graphql.String,
},
},
})
`
when make this get Error: Introspection must provide input type for arguments.
The text was updated successfully, but these errors were encountered: