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

Drop graphql-tag #12

Merged
merged 1 commit into from Jun 6, 2023
Merged

Drop graphql-tag #12

merged 1 commit into from Jun 6, 2023

Conversation

TrySound
Copy link
Collaborator

@TrySound TrySound commented Jun 6, 2023

Graphql-tag is tagged template which parses and normalizes queries inside. In generated schema it means running parser in runtime. Though why do we need to parse when we already have compiler to do all the job.

Here I switched to "string" document mode to generate template literals without any tags. So there is no more runtime overhead.

The only issue is duplicated fragments which break pinned posts query. dedupeFragments helps to solve this by removing dependencies from fragments and listing them all in queries.

Graphql-tag is tagged template which parses and normalizes queries
inside. In generated schema it means running parser in runtime.
Though why do we need to parse when we already have compiler to do all
the job.

Here I switched to "string" document mode to generate template literals
without any tags. So there is no more runtime overhead.

The only issue is duplicated fragments which break pinned posts query.
dedupeFragments helps to solve this by removing dependencies from
fragments and listing them all in queries.
@TrySound TrySound requested a review from renatorib June 6, 2023 07:31
@TrySound TrySound merged commit 0b91234 into master Jun 6, 2023
1 check passed
@TrySound TrySound deleted the drop-graphql-tag branch June 6, 2023 13:45
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

Successfully merging this pull request may close these issues.

None yet

2 participants