-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix broken emission of
__typename
field type (#47)
* test: add snapshot with current state * fix: correct emission of __typename field's type
- Loading branch information
Showing
4 changed files
with
100 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
24 changes: 24 additions & 0 deletions
24
...nter/tests/snapshots/nitrogql_printer__operation_type_printer__tests__typename_field.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
source: crates/printer/src/operation_type_printer/tests/mod.rs | ||
expression: printed | ||
--- | ||
import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; | ||
import type * as Schema from ""; | ||
|
||
type Result = Schema.__SelectionSet<Schema.__OperationOutput.Query, { | ||
me: Schema.__SelectionSet<Schema.__OperationOutput.User, { | ||
__typename: "User"; | ||
id: Schema.__OperationOutput.ID; | ||
name: Schema.__OperationOutput.String; | ||
type: Schema.__OperationOutput.UserType; | ||
age: Schema.__OperationOutput.Int | null; | ||
}, {}>; | ||
}, {}>; | ||
|
||
type Variables = {}; | ||
|
||
declare const Query: TypedDocumentNode<Result, Variables>; | ||
|
||
export { Query as default }; | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
...s/snapshots/nitrogql_printer__operation_type_printer__tests__typename_field_on_union.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
source: crates/printer/src/operation_type_printer/tests/mod.rs | ||
expression: printed | ||
--- | ||
import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; | ||
import type * as Schema from ""; | ||
|
||
type Result = Schema.__SelectionSet<Schema.__OperationOutput.Query, { | ||
me: Schema.__SelectionSet<Schema.__OperationOutput.User, { | ||
posts: (Schema.__SelectionSet<Schema.__OperationOutput.User, { | ||
__typename: "User"; | ||
id: Schema.__OperationOutput.ID; | ||
}, {}> | Schema.__SelectionSet<Schema.__OperationOutput.Bot, { | ||
__typename: "Bot"; | ||
id: Schema.__OperationOutput.ID; | ||
}, {}> | Schema.__SelectionSet<Schema.__OperationOutput.Post, { | ||
__typename: "Post"; | ||
id: Schema.__OperationOutput.ID; | ||
title: Schema.__OperationOutput.String; | ||
}, {}> | Schema.__SelectionSet<Schema.__OperationOutput.Tweet, { | ||
__typename: "Tweet"; | ||
id: Schema.__OperationOutput.ID; | ||
}, {}>)[]; | ||
}, {}>; | ||
}, {}>; | ||
|
||
type Variables = {}; | ||
|
||
declare const Query: TypedDocumentNode<Result, Variables>; | ||
|
||
export { Query as default }; | ||
|
||
|