DEVPROD-31333: Switch to gql templates from .graphql#1532
Merged
sophstad merged 13 commits intoevergreen-ci:mainfrom Apr 10, 2026
Merged
DEVPROD-31333: Switch to gql templates from .graphql#1532sophstad merged 13 commits intoevergreen-ci:mainfrom
sophstad merged 13 commits intoevergreen-ci:mainfrom
Conversation
Replace babel-plugin-import-graphql by converting all .graphql query, mutation, and fragment files to TypeScript files using Apollo Client's gql template literal syntax. This removes the dependency on babel-plugin-import-graphql and is a prerequisite for fully removing Babel from the build pipeline. Changes: - Convert ~200 .graphql files to .ts with gql tagged templates - Update barrel index.ts files to import from .ts instead of .graphql - Update graphql-codegen configs to scan .ts files for gql tags - Remove babel-plugin-import-graphql from vite/vitest configs - Remove babel-plugin-import-graphql from package.json devDependencies - Remove *.graphql module declarations from vite-env.d.ts files Made-with: Cursor
Convert all query/mutation files from default exports to named exports and simplify barrel index files to single-line re-exports. This aligns with the fragment files which already used named exports. Made-with: Cursor
All gql template literals live under src/gql/, so restrict the codegen documents glob to avoid scanning the entire src tree. Made-with: Cursor
Remove 10 query/mutation/fragment files that were converted from .graphql files already deleted on main (logkeeper removal, pod queries, beta features duplicated in lib, etc.). Update graphql-eslint config to use the processor for extracting GraphQL from gql tagged template literals in .ts files instead of linting .graphql files directly. Made-with: Cursor
Each gql tag only includes the fragment definitions it actually spreads, eliminating runtime unused-fragment warnings from Apollo. Made-with: Cursor
…e-migration Made-with: Cursor # Conflicts: # apps/spruce/src/gql/fragments/projectSettings/variables.graphql # apps/spruce/src/gql/mutations/index.ts # apps/spruce/src/gql/mutations/save-admin-settings.graphql # apps/spruce/src/gql/queries/admin-settings.graphql # apps/spruce/src/gql/queries/index.ts # apps/spruce/src/gql/queries/user-distro-settings-permissions.graphql # apps/spruce/src/gql/queries/user-project-settings-permissions.graphql # apps/spruce/src/gql/queries/user-repo-settings-permissions.graphql # pnpm-lock.yaml
…e-migration Made-with: Cursor # Conflicts: # packages/eslint-config/eslint.config.js
Made-with: Cursor
athammer
reviewed
Apr 10, 2026
Contributor
There was a problem hiding this comment.
we can remove this i deleted this one in an earlier pr
athammer
approved these changes
Apr 10, 2026
Contributor
athammer
left a comment
There was a problem hiding this comment.
lotta files but other than the thing i commented above not really seeing anything popping out
…e-migration Made-with: Cursor # Conflicts: # apps/spruce/src/gql/queries/task-files.graphql
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DEVPROD-31333
Description
Convert our
.graphqlfiles into TypeScript files that use Apollo'sgqltag. Using.graphqlfiles requires a Babel transform, which:Ahead of upgrading, let's try removing this major Babel dependency. The last remaining one is for Emotion, which will be done in a followup.
Changes
.graphqlfilevite-plugin-import-graphql