-
-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added '@' prefix when exporting directives in Apollo. (#7812)
- Loading branch information
1 parent
4cbe8b9
commit 3b6e888
Showing
4 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ceTypeEmptyQueryTypePureCodeFirst.graphql → ...ExportDirectiveUsingNameCodeFirst.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
.../Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingTypeCodeFirst.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
schema @composeDirective(name: "@custom") @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet", "@composeDirective" ]) @link(url: "https:\/\/specs.custom.dev\/custom\/v1.0", import: [ "@custom" ]) { | ||
query: Query | ||
} | ||
|
||
type Address @key(fields: "field") { | ||
field: String! @custom | ||
} | ||
|
||
type Query { | ||
_service: _Service! | ||
_entities(representations: [_Any!]!): [_Entity]! | ||
} | ||
|
||
"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." | ||
type _Service { | ||
sdl: String! | ||
} | ||
|
||
"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." | ||
union _Entity = Address | ||
|
||
"Marks underlying custom directive to be included in the Supergraph schema." | ||
directive @composeDirective(name: String!) repeatable on SCHEMA | ||
|
||
directive @custom on FIELD_DEFINITION | ||
|
||
"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." | ||
directive @key(fields: FieldSet! resolvable: Boolean = true) repeatable on OBJECT | INTERFACE | ||
|
||
"Links definitions within the document to external schemas." | ||
directive @link("Gets imported specification url." url: String! "Gets optional list of imported element names." import: [String!]) repeatable on SCHEMA | ||
|
||
"Scalar representing a set of fields." | ||
scalar FieldSet | ||
|
||
"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." | ||
scalar _Any |