Skip to content

Commit

Permalink
fix: use gqlTagName in the autogenerated example (#8995)
Browse files Browse the repository at this point in the history
Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
  • Loading branch information
charpeni and n1ru4l authored Feb 16, 2023
1 parent 9c600c6 commit fe2e9c7
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 116 deletions.
6 changes: 6 additions & 0 deletions .changeset/nasty-eggs-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/gql-tag-operations': patch
'@graphql-codegen/client-preset': patch
---

Use `gqlTagName` for generated examples
2 changes: 1 addition & 1 deletion dev-test/gql-tag-operations/graphql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/persisted-documents/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/react/apollo-client/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/react/babel-optimized/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/react/graphql-request/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/react/nextjs-swr/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/react/tanstack-react-query/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/react/urql/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript-esm/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript-graphql-request/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/apollo-composable/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/urql/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/villus/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
2 changes: 1 addition & 1 deletion examples/yoga-tests/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const documents = {
*
* @example
* ```ts
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const plugin: PluginFunction<{
`/**\n * The ${gqlTagName} function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n`,
` *\n * @example\n`,
' * ```ts\n',
' * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n',
` * const query = ${gqlTagName}` + '(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n',
' * ```\n *\n',
` * The query argument is unknown!\n`,
` * Please regenerate the types.\n`,
Expand Down
Loading

0 comments on commit fe2e9c7

Please sign in to comment.