Open
Description
Apollo Federation makes uses of some custom directives:
https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
Version and Environment Details
Operation system: macOS
IDE name and version: IntelliJ IDEA Ultimate 2019.2
Plugin version: 2.2.0
Expected Behaviour
-
The following directives should not produce errors:
directive @external on FIELD_DEFINITION directive @requires(fields: _FieldSet!) on FIELD_DEFINITION directive @provides(fields: _FieldSet!) on FIELD_DEFINITION directive @key(fields: _FieldSet!) on OBJECT | INTERFACE directive @extends on OBJECT | INTERFACE
(These directives must NOT be in the GraphQL file itself)
-
An
extend type TypeName
should be allowed to exist without the base type, as the base type may be defined by another service
Actual Behaviour
- Error:
Unknown directive "XXX"
- Error:
The extension 'TypeName' type [@x:x] is missing its base underlying type
Steps to Reproduce / Link to Repo with Reproduction and Instructions
type InternalType @key(fields: "id") {
id: ID!
xyz: String!
externalObject: ExternalType @requires(fields: "xyz") @provides(fields: "foo")
}
# In reality you need EITHER extend OR @extends
# depending on which server this schema is defined in
# (Apollo Server allows extend, graphql-java requires @extends)
extend type ExternalType @key(fields: "id") @extends {
id: ID! @external
foo: String! @external
bar: String! @external
baz: String!
}