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

Rename graphql export to g #19

Merged
merged 10 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cool-oranges-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-ts/extend": patch
---

Documentation updates to align with the renaming of the `graphql` export to `g` in `@graphql-ts/schema`
15 changes: 15 additions & 0 deletions .changeset/nasty-turkeys-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@graphql-ts/schema": patch
---

The `graphql` export has been renamed to `g` to make reading/writing schemas more concise and to avoid conflicts with exports named `graphql` from libraries such as Relay, GraphQL Code Generator and gql.tada that use the variable name `graphql` to declare GraphQL operations.

The `graphql` export still exists but is now deprecated and may be removed in a future release.

To quickly update usages of the `graphql` export in your project to use `g`:

1. Navigate to `node_modules/@graphql-ts/schema/dist/declarations/src/schema-api-alias.d.ts` in your editor ("Go to Definition" will not take you to the correct file)
2. Use "Rename Symbol" to rename `graphql` to `g`, this will update usages of `graphql` to `g`
3. Change this deprecated alias back from `g` to `graphql` (avoid using "Rename Symbol" again because you want to preserve the updates you made in step 2)

You can similarly use "Rename Symbol" to quickly rename your own custom defined `graphql` to `g`.
2 changes: 1 addition & 1 deletion packages/extend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"graphql": "15 || 16"
},
"devDependencies": {
"@graphql-ts/schema": "^0.6.0",
"@graphql-ts/schema": "workspace:^",
"graphql": "^16.3.0"
},
"repository": "https://github.com/Thinkmill/graphql-ts/tree/main/packages/extend"
Expand Down
Loading