Skip to content

Commit

Permalink
Merge pull request #183 from sangria-graphql/fed2-add-@tag
Browse files Browse the repository at this point in the history
feat(fed2): add @tag
  • Loading branch information
Soufiane Maguerra authored Oct 13, 2022
2 parents 6760326 + f639301 commit 5b7b748
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions core/src/main/scala/sangria/federation/v2/Directives.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ object Directives {
Argument("from", StringType)
),
locations = Set(DirectiveLocation.FieldDefinition)
),
Directive(
name = "tag",
arguments = List(
Argument("name", StringType)
),
locations = Set(
DirectiveLocation.FieldDefinition,
DirectiveLocation.Object,
DirectiveLocation.Interface,
DirectiveLocation.Union,
DirectiveLocation.ArgumentDefinition,
DirectiveLocation.Scalar,
DirectiveLocation.Enum,
DirectiveLocation.EnumValue,
DirectiveLocation.InputObject,
DirectiveLocation.InputFieldDefinition
),
repeatable = true
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class FederationSpec extends AsyncFreeSpec {
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION

directive @override(from: String!) on FIELD_DEFINITION
directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
""")
.extend(Document(
Vector(_FieldSet.Type.toAst, Link__Import.Type.toAst, Link__Purpose.Type.toAst)))
Expand Down Expand Up @@ -159,6 +161,8 @@ class FederationSpec extends AsyncFreeSpec {
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION

directive @override(from: String!) on FIELD_DEFINITION
directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
""")
.extend(Document(
Vector(_FieldSet.Type.toAst, Link__Import.Type.toAst, Link__Purpose.Type.toAst)))
Expand Down

0 comments on commit 5b7b748

Please sign in to comment.