From 52743e8c3985135f4d4f04c1e4e20a813b2013e6 Mon Sep 17 00:00:00 2001 From: francisu Date: Tue, 7 Apr 2020 06:47:23 -0700 Subject: [PATCH 1/2] Allow directives on arguments, object fields --- spec/Appendix B -- Grammar Summary.md | 6 ++++-- spec/Section 2 -- Language.md | 4 ++-- spec/Section 3 -- Type System.md | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/Appendix B -- Grammar Summary.md b/spec/Appendix B -- Grammar Summary.md index a0ab1494f..aca9c3d3f 100644 --- a/spec/Appendix B -- Grammar Summary.md +++ b/spec/Appendix B -- Grammar Summary.md @@ -145,7 +145,7 @@ Alias : Name : Arguments[Const] : ( Argument[?Const]+ ) -Argument[Const] : Name : Value[?Const] +Argument[Const] : Name Directives? : Value[?Const] FragmentSpread : ... FragmentName Directives? @@ -182,7 +182,7 @@ ObjectValue[Const] : - { } - { ObjectField[?Const]+ } -ObjectField[Const] : Name : Value[?Const] +ObjectField[Const] : Name Directives? : Value[?Const] VariableDefinitions : ( VariableDefinition+ ) @@ -322,6 +322,8 @@ ExecutableDirectiveLocation : one of `FRAGMENT_SPREAD` `INLINE_FRAGMENT` `VARIABLE_DEFINITION` + `ARGUMENT` + `OBJECT_FIELD` TypeSystemDirectiveLocation : one of `SCHEMA` diff --git a/spec/Section 2 -- Language.md b/spec/Section 2 -- Language.md index e9ec5bfd2..460e2b1cb 100644 --- a/spec/Section 2 -- Language.md +++ b/spec/Section 2 -- Language.md @@ -395,7 +395,7 @@ unique identifier. Arguments[Const] : ( Argument[?Const]+ ) -Argument[Const] : Name : Value[?Const] +Argument[Const] : Name Directives? : Value[?Const] Fields are conceptually functions which return values, and occasionally accept arguments which alter their behavior. These arguments often map directly to @@ -1033,7 +1033,7 @@ ObjectValue[Const] : - { } - { ObjectField[?Const]+ } -ObjectField[Const] : Name : Value[?Const] +ObjectField[Const] : Name Directives? : Value[?Const] Input object literal values are unordered lists of keyed input values wrapped in curly-braces `{ }`. The values of an object literal may be any input value diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index e68ae473c..60c283fd1 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -1712,7 +1712,7 @@ Expected Type | Internal Value | Coerced Result `[Int!]!` | `[1, 2, null]` | Error: Item cannot be null `[Int!]!` | `[1, 2, Error]` | Error: Error occurred in item - +```` ## Directives DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations @@ -1734,6 +1734,8 @@ ExecutableDirectiveLocation : one of `FRAGMENT_SPREAD` `INLINE_FRAGMENT` `VARIABLE_DEFINITION` + `ARGUMENT` + `OBJECT_FIELD` TypeSystemDirectiveLocation : one of `SCHEMA` From f089b0be972483baffbfac31eb8fa39c5bb548c8 Mon Sep 17 00:00:00 2001 From: francisu Date: Tue, 7 Apr 2020 07:58:55 -0700 Subject: [PATCH 2/2] Allow directives on object fields --- spec/Appendix B -- Grammar Summary.md | 5 ++--- spec/Section 2 -- Language.md | 4 ++-- spec/Section 3 -- Type System.md | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/Appendix B -- Grammar Summary.md b/spec/Appendix B -- Grammar Summary.md index aca9c3d3f..5474b55b7 100644 --- a/spec/Appendix B -- Grammar Summary.md +++ b/spec/Appendix B -- Grammar Summary.md @@ -145,7 +145,7 @@ Alias : Name : Arguments[Const] : ( Argument[?Const]+ ) -Argument[Const] : Name Directives? : Value[?Const] +Argument[Const] : Name : Value[?Const] FragmentSpread : ... FragmentName Directives? @@ -182,7 +182,7 @@ ObjectValue[Const] : - { } - { ObjectField[?Const]+ } -ObjectField[Const] : Name Directives? : Value[?Const] +ObjectField[Const] : Directives? Name : Value[?Const] VariableDefinitions : ( VariableDefinition+ ) @@ -322,7 +322,6 @@ ExecutableDirectiveLocation : one of `FRAGMENT_SPREAD` `INLINE_FRAGMENT` `VARIABLE_DEFINITION` - `ARGUMENT` `OBJECT_FIELD` TypeSystemDirectiveLocation : one of diff --git a/spec/Section 2 -- Language.md b/spec/Section 2 -- Language.md index 460e2b1cb..6ce1ab6e7 100644 --- a/spec/Section 2 -- Language.md +++ b/spec/Section 2 -- Language.md @@ -395,7 +395,7 @@ unique identifier. Arguments[Const] : ( Argument[?Const]+ ) -Argument[Const] : Name Directives? : Value[?Const] +Argument[Const] : Name : Value[?Const] Fields are conceptually functions which return values, and occasionally accept arguments which alter their behavior. These arguments often map directly to @@ -1033,7 +1033,7 @@ ObjectValue[Const] : - { } - { ObjectField[?Const]+ } -ObjectField[Const] : Name Directives? : Value[?Const] +ObjectField[Const] : Directives? Name : Value[?Const] Input object literal values are unordered lists of keyed input values wrapped in curly-braces `{ }`. The values of an object literal may be any input value diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index 60c283fd1..87d9e2304 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -1712,7 +1712,7 @@ Expected Type | Internal Value | Coerced Result `[Int!]!` | `[1, 2, null]` | Error: Item cannot be null `[Int!]!` | `[1, 2, Error]` | Error: Error occurred in item -```` + ## Directives DirectiveDefinition : Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations @@ -1734,7 +1734,6 @@ ExecutableDirectiveLocation : one of `FRAGMENT_SPREAD` `INLINE_FRAGMENT` `VARIABLE_DEFINITION` - `ARGUMENT` `OBJECT_FIELD` TypeSystemDirectiveLocation : one of