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

PageInfo needs to be shareable in GraphQL Federation #207

Open
zche-theScore opened this issue Mar 25, 2024 · 1 comment
Open

PageInfo needs to be shareable in GraphQL Federation #207

zche-theScore opened this issue Mar 25, 2024 · 1 comment

Comments

@zche-theScore
Copy link

Hi folks,

I want to use absinthe_relay in a GraphQL Federation subgraph.

However, as explained here, PageInfo must be declared as @shareable.

I am using absinthe_federation, and I wanted to add shareable to the PageInfo type.

Is there a way to do this in my own project without touching the libraries? Thanks!!!

@kzlsakal
Copy link

As a workaround, we use a pipeline modifier to add the shareable directive to the PageInfo object if it exists. You can find more information about the usage of those here.

Essentially what you'd want to do is prewalking the blueprint and if the object matches with %Absinthe.Blueprint.Schema.ObjectTypeDefinition{name: "PageInfo"} pattern, you'd want to inject %Absinthe.Blueprint.Directive{name: "shareable"} in the directives.

Since the shareable directive doesn't exist in non-federated graphs, it's understandable to not have it in the page_info definition in this library.

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

No branches or pull requests

2 participants