Open ghost opened 5 years ago
A few more informations, it looks like the error is internally related to ApolloGateway not passing the authorization header to the introspection query.
Apollo is discussing how to do that at the moment, but after adding it for now, the error received is different:
const gateway = new ApolloGateway({
// ...
introspectionHeaders: {
'authorization': process.env.DATOCMS_API_KEY
},
// ...
});
Field '_service' doesn't exist on type 'Query'
I think the federation introspection query looks sort of:
query GetServiceDefinition {
_service {
sdl
}
}
I also received the same error in Insomnia. I believe it does confirm that DatoCMS at the moment does not implement those specifications?
I had the same issue. Vanilla GraphQL servers are not supported. You have to add federation support to the underlying service: https://www.apollographql.com/docs/apollo-server/federation/migrating-from-stitching/#adding-federation-support-to-services
This feature request has been moved to https://community.datocms.com/t/243
Is your feature request related to a problem? Please describe. For an ongoing project, I need to implement an Apollo Gateway for a project, with a federated GraphQL schema from several sources, including DatoCMS. Apollo provides those features already, it just requires the different GraphQL schemas to implement the Federation specifications: https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
I tried implementing a Gateway with DatoCMS as one of the federated source, but I do not think DatoCMS schema currently implements those specifications (unless I am doing something wrong?)
Describe the solution you'd like Is it possible for DatoCMS to consider implementing those? The migration from ApolloSever is pretty straightforward (not sure which tech is DatoCMS using under the hood but the @apollo/federation package can probably help, directly or as an example?) https://www.apollographql.com/docs/apollo-server/federation/implementing/
Describe alternatives you've considered An alternative would be to use DatoCMS as a Datasource for ApolloServer, but I am afraid to loose all the benefits of GraphQL by doing that? https://spectrum.chat/apollo/apollo-federation/remote-schemas-and-apollo-federation~74f89ac9-2623-4c51-bb87-8880a140fc27
Additional context This is the local Gateway implementation I have tried (using node.js):