Skip to content

Commit 8146575

Browse files
committed
Changesets and doc updates
1 parent 7770940 commit 8146575

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

.changeset/cool-oranges-tease.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-ts/extend": patch
3+
---
4+
5+
Documentation updates to align with the renaming of the `graphql` export to `g` in `@graphql-ts/schema`

.changeset/nasty-turkeys-destroy.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@graphql-ts/schema": patch
3+
---
4+
5+
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.
6+
7+
The `graphql` export still exists but is now deprecated and may be removed in a future release.
8+
9+
To quickly update usages of the `graphql` export in your project to use `g`:
10+
11+
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)
12+
2. Use "Rename Symbol" to rename `graphql` to `g`, this will update usages of `graphql` to `g`
13+
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)
14+
15+
You can similarly use "Rename Symbol" to quickly rename your own custom defined `graphql` to `g`.
+16-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1+
import * as _graphql from "./schema-api";
2+
13
/**
24
* The `graphql` export has been renamed to `g`.
35
*
46
* To quickly update usages of `graphql` in your project to `g`:
57
*
6-
* 1. Use your editor's "Go to Definition" to go navigate to where this deprecated
7-
* alias is defined
8+
* 1. Navigate to
9+
* `node_modules/@graphql-ts/schema/dist/declarations/src/schema-api-alias.d.ts`
10+
* in your editor ("Go to Definition" will not take you to the correct file)
811
* 2. Use "Rename Symbol" to rename `graphql` to `g`, this will update usages of
912
* `graphql` to `g`
1013
* 3. Change this deprecated alias back from `g` to `graphql` using normal text
11-
* editing to preserve the updates you made in step 2
14+
* editing (avoid using "Rename Symbol" again because you want to preserve
15+
* the updates you made in step 2)
1216
*
13-
* You can similarly use "Rename Symbol" to quickly rename your own custom
14-
* defined `graphql` to `g` if you wish.
17+
* You can also use "Rename Symbol" to quickly rename your own custom defined
18+
* `graphql` export to `g`.
1519
*
1620
* @deprecated
1721
*/
18-
export import graphql = require("./schema-api");
22+
// this is what you should run "Rename Symbol" on
23+
// when that is done, you should change it back to `export import graphql = _graphql;`
24+
// avoid using "Rename Symbol" to revert it because you want to
25+
// preserve the updates you made to the usages of `graphql`
26+
// |||||||
27+
// vvvvvvv
28+
export import graphql = _graphql;

0 commit comments

Comments
 (0)