Open
Description
Recently the issue was raised for the Python port graphql-core that enum values aren't validated against their defintion when they are used as default arguments SDL. This is the example that was given:
const sdl = `
enum Role {
ADMIN
USER
}
type Query {
hello(r: Role = ADMIN): String
complex(i: Test = { role: DOES_NOT_EXIST }): String
complexAlt(i: Test): String
}
input Test {
ignore: String
role: Role = INVALID
}
`
const schema = graphql.buildASTSchema(graphql.parse(sdl))
const fields = schema.getType('Query').getFields()
const arg1 = fields.hello.args[0]
const arg2 = fields.complex.args[0]
console.log(arg1, arg2)
Should schema validation not show this is an error?
Metadata
Metadata
Assignees
Labels
No labels