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

Client directive blocks ability to use links #7782

Closed
brianmmorton opened this issue Mar 3, 2021 · 1 comment
Closed

Client directive blocks ability to use links #7782

brianmmorton opened this issue Mar 3, 2021 · 1 comment

Comments

@brianmmorton
Copy link

I have an architecture where there is no graphql backend, and I have my resolver code locally on the client. Each resolver sends an api request to a specified rest endpoint with a number of query parameters. Given that resolvers are semi custom built in many scenarios in order to make slight modifications to the queries made and how to store the results in the apollo cache, i can't really use the apollo-http-link (i dont think). But since im doing this, i have to use the @client directive in my queries.

Given that I have to use the client directive, im no longer able to add in links for doing things like logging cache misses, logging queries to the rest endpoint, or anything else. This would be enormously helpful. I believe the root reason is because you designed the links to only run with server queries, as specified in the code here https://github.com/apollographql/apollo-client/blob/main/src/core/QueryManager.ts#L783. So im curious if there is a specific reason for that? And do you all have suggestions for using links with local resolvers if so?

@vigie
Copy link

vigie commented Mar 5, 2021

I have also come up against this issue and had to work around it in less elegant ways.

Unfortunately I suspect we are unlikely to get further support for local resolvers from the core team.

If you haven't already seen this issue you might be interested: #7072

@apollographql apollographql locked and limited conversation to collaborators May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants