-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
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
introduce GraphQLField, GraphQLInputField, GraphQLArgument, and GraphQLEnumValue #4288
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,11 @@ import type { | |
import { Kind } from '../language/kinds.js'; | ||
|
||
import type { GraphQLArgument, GraphQLField } from '../type/definition.js'; | ||
import { isNonNullType, isRequiredArgument } from '../type/definition.js'; | ||
import { | ||
isArgument, | ||
isNonNullType, | ||
isRequiredArgument, | ||
} from '../type/definition.js'; | ||
import type { GraphQLDirective } from '../type/directives.js'; | ||
import type { GraphQLSchema } from '../type/schema.js'; | ||
|
||
|
@@ -222,7 +226,7 @@ export function experimentalGetArgumentValues( | |
// execution. This is a runtime check to ensure execution does not | ||
// continue with an invalid argument value. | ||
throw new GraphQLError( | ||
`Argument "${argDef.name}" of required type "${argType}" was not provided.`, | ||
`Argument "${isArgument(argDef) ? argDef : argDef.name}" of required type "${argType}" was not provided.`, | ||
{ nodes: node }, | ||
); | ||
} | ||
|
@@ -272,7 +276,7 @@ export function experimentalGetArgumentValues( | |
valueNode, | ||
argType, | ||
(error, path) => { | ||
error.message = `Argument "${argDef.name}" has invalid value${printPathArray( | ||
error.message = `Argument "${isArgument(argDef) ? argDef : argDef.name}" has invalid value${printPathArray( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar question here but I guess it could be a VariableSignature? In which case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it could be a variable signature, which is "a kind of argument definition", but confusing. We should probably rename |
||
path, | ||
)}: ${error.message}`; | ||
throw error; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this not be an argument? This check feels a bit redundant given the parent check where we check whether it in fact is a required argument