Unmanaged Federated Gateway Does Not Permit Type System Directives

I’m using the latest Apollo Federated Gateway docker container (image: graphql/gateway) pointing to a single Dgraph GraphQL endpoint with a basic schema. When I try to start the container, it fails to start with the following errors:

 (node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): GraphQLSchemaValidationError: [http://alpha:8081/graphql] @hasInverse -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @search -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @dgraph -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @id -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @withSubscription -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @secret -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @remote -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @remoteResponse -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @lambda -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION
 [http://alpha:8081/graphql] @lambdaOnMutate -> is a type system directive, but only executable directives are permitted. Executable directives exist for the following locations: QUERY, MUTATION, SUBSCRIPTION, FIELD, FRAGMENT_DEFINITION, FRAGMENT_SPREAD, INLINE_FRAGMENT, VARIABLE_DEFINITION

I have not been able to find any documentation explaining why type system directives are not permitted. Can anyone give me a brief explanation and/or point me to some documentation that will help me understand the issue?

Hi @walpolet,

This validation is something that isn’t enforced anymore. The docker image you referenced is very out of date and isn’t something that Apollo maintains, so I can’t provide much assistance there.

I would recommend either reaching out on that repo to see if the maintainer is willing to update the image, or possibly forking it and maintaining your own image if using Docker is a requirement for you.

2 Likes

Makes a lot of sense :slight_smile: Thank you!

1 Like