Skip to content

Commit 367cf37

Browse files
committed
Fix #100
1 parent eacd03b commit 367cf37

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

include/graphqlservice/GraphQLGrammar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ struct directive_definition_start
11071107
};
11081108

11091109
struct directive_definition_content
1110-
: seq<star<ignored>, one<'@'>, directive_name, arguments_definition, plus<ignored>, on_keyword, plus<ignored>, directive_locations>
1110+
: seq<star<ignored>, one<'@'>, directive_name, opt<star<ignored>, arguments_definition>, plus<ignored>, on_keyword, plus<ignored>, directive_locations>
11111111
{
11121112
};
11131113

samples/schema.today.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ schema {
99

1010
scalar ItemCursor
1111

12+
directive @id on FIELD_DEFINITION
13+
1214
"Root Query type"
1315
type Query {
1416
"""[Object Identification](https://facebook.github.io/relay/docs/en/graphql-server-specification.html#object-identification)"""

samples/separate/TodaySchema.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ void AddTypesToSchema(const std::shared_ptr<introspection::Schema>& schema)
183183
AddNestedTypeDetails(typeNestedType, schema);
184184
AddExpensiveDetails(typeExpensive, schema);
185185

186+
schema->AddDirective(std::make_shared<introspection::Directive>("id", R"md()md", std::vector<response::StringType>({
187+
R"gql(FIELD_DEFINITION)gql"
188+
}), std::vector<std::shared_ptr<introspection::InputValue>>()));
186189
schema->AddDirective(std::make_shared<introspection::Directive>("subscriptionTag", R"md()md", std::vector<response::StringType>({
187190
R"gql(SUBSCRIPTION)gql"
188191
}), std::vector<std::shared_ptr<introspection::InputValue>>({

samples/unified/TodaySchema.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,9 @@ void AddTypesToSchema(const std::shared_ptr<introspection::Schema>& schema)
11941194
std::make_shared<introspection::Field>("order", R"md()md", std::nullopt, std::vector<std::shared_ptr<introspection::InputValue>>(), schema->WrapType(introspection::TypeKind::NON_NULL, schema->LookupType("Int")))
11951195
});
11961196

1197+
schema->AddDirective(std::make_shared<introspection::Directive>("id", R"md()md", std::vector<response::StringType>({
1198+
R"gql(FIELD_DEFINITION)gql"
1199+
}), std::vector<std::shared_ptr<introspection::InputValue>>()));
11971200
schema->AddDirective(std::make_shared<introspection::Directive>("subscriptionTag", R"md()md", std::vector<response::StringType>({
11981201
R"gql(SUBSCRIPTION)gql"
11991202
}), std::vector<std::shared_ptr<introspection::InputValue>>({

0 commit comments

Comments
 (0)