Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apollo router integration example #162

Open
tot-ra opened this issue Oct 7, 2022 · 5 comments
Open

Add apollo router integration example #162

tot-ra opened this issue Oct 7, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@tot-ra
Copy link
Owner

tot-ra commented Oct 7, 2022

No description provided.

@tot-ra tot-ra added the documentation Improvements or additions to documentation label Oct 7, 2022
@rweintraub-cycleon
Copy link

Hey @tot-ra,
i've been trying to set-up the registry on my local environment and realized that all the examples require several portions of js scripts to work in conjunction to be able to push the schemas. I've now managed to push two example schemas from my end but realized that the /schema/compose API is returning a different format than expected by the Apollo Router.

i found this issue and was wondering if you've mad some progress on this. I was wondering if it'd make sense to have an endpoint that composes the supergraph within the registry and then just returns the composed supergraph.

is there any way i could support here?

@ehardy
Copy link
Contributor

ehardy commented Mar 29, 2023

We have done just that in our forked version of the registry in order to support GraphQL Federation v2. We have added an API endpoint that returns the fully built supergraph. This removes a fair amount of logic from our GraphQL Gateway as it does not have to build the supergraph anymore. It just has to call the registry's API to fetch the latest supergraph, which is then ready to serve. I had on my todo list to propose this feature back here, just haven't had the time. I could try and find some time to open a PR.

@flou
Copy link

flou commented Mar 30, 2023

@ehardy We've been working on a similar thing where the router directly connects to the registry and requests the full supergraph. It's been working well until we tried to upgrade the router to 1.12.0 because of the new entitlements.
Did you manage to work around that?

@ehardy
Copy link
Contributor

ehardy commented Mar 30, 2023

@flou We haven't faced such an issue since we are not using Router yet. We are still using a node.js based GraphQL Gateway. We are planning to move to Router though. Could you expand on the issue with entitlements?

@flou
Copy link

flou commented Mar 31, 2023

@ehardy After digging a bit more it turns out that it's not blocking anything.

The entitlements are a way for the router to restrict the usage of enterprise features (like external cache, JWT auth and coprocessors), the router does that by sending a request to the registry asking for a new type which contains an entitlement with a signed JWT.

I didn't closely enough at first but the entitlement field in the response of the registry can be omitted, and in that case the router is able to start without restricted features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants