You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
The Apollo Link execute function currently requires a GraphQL query AST generated by the graphql-js library. Would it be better to accept a GraphQL query string? Links that need the AST could import graphql-js and parse it. Looking through the modules in this repo, most links are just calling print on the AST to get the query string.
For some of the use cases in the README (GraphiQL, Relay Modern) you have a query string and need to import graphql-js to parse it, only for Link to re-print it almost immediately. In the Relay Modern case, this means loading the rather large graphql-js module on the client just for that purpose. Maybe this dependency can be dropped from apollo-link?
The text was updated successfully, but these errors were encountered:
I really like the abstraction that apollo-link and it's relatives holds.
However there is no real need of requiring a full graphql parser + engine into the network link by itself.
At the end queries that are sent over the wire will be with either a text string or a query id.
Because of that I think it might be useful to move the dependency of the graphql-tag and graphql over to Apollo Client or it's cache mechanisms (in the one that, for example, injects a __typename into each of the selectionsets).
Could be possible to remove the graphql-tag and graphql dependency from this packages?
The Apollo Link
execute
function currently requires a GraphQL query AST generated by thegraphql-js
library. Would it be better to accept a GraphQL query string? Links that need the AST could importgraphql-js
and parse it. Looking through the modules in this repo, most links are just calling print on the AST to get the query string.For some of the use cases in the README (GraphiQL, Relay Modern) you have a query string and need to import
graphql-js
to parse it, only for Link to re-print it almost immediately. In the Relay Modern case, this means loading the rather largegraphql-js
module on the client just for that purpose. Maybe this dependency can be dropped fromapollo-link
?The text was updated successfully, but these errors were encountered: