Skip to content

Commit

Permalink
Add comment to parser about document directive
Browse files Browse the repository at this point in the history
  • Loading branch information
twof committed Nov 8, 2024
1 parent c472b9e commit 163785d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/language/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ export class Parser {
* - InputObjectTypeDefinition
*/
parseDefinition(): DefinitionNode {
// TODO: I don't know what isConst represents. Every other callsite has it false
const directives = this.parseDirectives(false);
// If a document-level SemanticNullability directive exists as
// the first element in a document, then all parsing will
// happen in SemanticNullability mode.
for (const directive of directives) {
if (directive.name.value === 'SemanticNullability') {
this._options.useSemanticNullability = true;
Expand Down

0 comments on commit 163785d

Please sign in to comment.