Repository navigation
Federation support #351
Description
Activity
I haven't used Apollo federation. Can you outline the specific requirements that'd be needed from this lib?
- addedadditional info neededAdditional information is needed to proceedAdditional information is needed to proceedenhancementNew feature or requestNew feature or request
on Jun 15, 2021 Apollo Federation allows you to implement a single data graph across multiple services. Libraries like pascaldevink/php-graphql-federation extends the current schema and enables federation, but it does not work well with graphqlite.
To make a GraphQL service federation capable, we need:
- Implementation of the federation schema specification.
- Support for fetching service capabilities.
- Implementation of stub type generation for references.
- Implementation of request resolving for entities.
Hope this helps. You need help implementing any of those features? Would be great to contribute to graphlite.
Thanks for the outlining that. I'm familiar with federation, just wasn't sure exactly what would be needed.
I'm not aware of any current initiatives or motivation to get federation added, at the moment. However, assuming this could be easily configured and doesn't cause performance implications, I don't see why there would be any objections to a PR raised with federation support. So yea, if you'd like to take a go at it, that'd be great.
- removedadditional info neededAdditional information is needed to proceedAdditional information is needed to proceed
on Jun 27, 2021 there's a new one https://github.com/Skillshare/apollo-federation-php
this one is added to the official list of "Subgraph-compatible server libraries"https://www.apollographql.com/docs/federation/other-servers/
@oojacoboo This discussion is a bit hold but do you have any plans to support the federation? 🙂 We would like to use
graphqlitein combination withapollo-federation-phpbut it doesn't seem a simple task.The framework needs to be adapted to support instantiating
EntityObjectTypeorEntityRefObjectType(for example by creating a new attribute#[ExternalType]). However, theMutableObjectTypeis extending theObjectTypeand we have multiple places checking if the object is instance ofMutableObjectType. Maybe we could have an interface (e.gObjectTypeInterface) whereMutableObjectTypewould extend from? And also provide a way to add custom types?I believe that wrapping the schema into a federated schema is already supported by doing something like this:
$config = $this->factory->createSchema()->getConfig(); $schema = new FederatedSchema( [ 'query' => $config->getQuery(), 'mutation' => $config->getMutation(), 'types' => $types, 'assumeValid' => true, ] );But we still need to find a way to create the external types :)
Thank you!
Reacted by Michael Georgiadis and fp-cfr@gtavares I still haven't looked into federation too much. But, wouldn't the goal be for GraphQLite to deliver it's schema into a federation server that combines with the rest of the federated graph?
I came across this related lib and docs as well: https://github.com/pascaldevink/php-graphql-federation/blob/master/README.md.
Also, see this discussion here around SDL output and caching and #569. It's possible we could also make use of this output for feeding to a federation server.
As for the changes you've mentioned in GraphQLite, why are these needed? Why can't GraphQLite deliver something like an SDL to a federation server and that server proxy the requests back to GraphQLite? I don't understand why the mentioned changes are necessary.
Do yo have any plans to support apollo federation?