-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add support for un-named definations
* fixed 2 cases with unnamed operation and query * fixed comments * chore: format files and minor updates --------- Co-authored-by: Rishabh Chawla <[email protected]>
- Loading branch information
1 parent
f5d8831
commit effac58
Showing
9 changed files
with
209 additions
and
7 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
tests/graphql_tag/definations/operation/unnamed_operation/input.js
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,3 @@ | ||
import gql from 'graphql-tag'; | ||
|
||
const foo = gql`{foo}`; |
33 changes: 33 additions & 0 deletions
33
tests/graphql_tag/definations/operation/unnamed_operation/output.js
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 @@ | ||
import gql from 'graphql-tag'; | ||
const foo = { | ||
"kind": "Document", | ||
"definitions": [ | ||
{ | ||
"kind": "OperationDefinition", | ||
"directives": [], | ||
"variableDefinitions": [], | ||
"operation": "query", | ||
"selectionSet": { | ||
"kind": "SelectionSet", | ||
"selections": [ | ||
{ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "foo" | ||
}, | ||
"arguments": [], | ||
"directives": [] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"loc": { | ||
"start": 0, | ||
"end": 5, | ||
"source": { | ||
"body": "{foo}" | ||
} | ||
} | ||
}; |
33 changes: 33 additions & 0 deletions
33
tests/graphql_tag/definations/operation/unnamed_operation/strip-output.js
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 @@ | ||
import gql from 'graphql-tag'; | ||
const foo = { | ||
"kind": "Document", | ||
"definitions": [ | ||
{ | ||
"kind": "OperationDefinition", | ||
"directives": [], | ||
"variableDefinitions": [], | ||
"operation": "query", | ||
"selectionSet": { | ||
"kind": "SelectionSet", | ||
"selections": [ | ||
{ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "foo" | ||
}, | ||
"arguments": [], | ||
"directives": [] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"loc": { | ||
"start": 0, | ||
"end": 5, | ||
"source": { | ||
"body": "{foo}" | ||
} | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
tests/graphql_tag/definations/operation/unnamed_query/input.js
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,3 @@ | ||
import gql from 'graphql-tag'; | ||
|
||
const foo = gql`query($foo: String!) {foo1}`; |
55 changes: 55 additions & 0 deletions
55
tests/graphql_tag/definations/operation/unnamed_query/output.js
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,55 @@ | ||
import gql from 'graphql-tag'; | ||
const foo = { | ||
"kind": "Document", | ||
"definitions": [ | ||
{ | ||
"kind": "OperationDefinition", | ||
"directives": [], | ||
"variableDefinitions": [ | ||
{ | ||
"kind": "VariableDefinition", | ||
"directives": [], | ||
"variable": { | ||
"kind": "Variable", | ||
"name": { | ||
"kind": "Name", | ||
"value": "foo" | ||
} | ||
}, | ||
"type": { | ||
"kind": "NonNullType", | ||
"type": { | ||
"kind": "NamedType", | ||
"name": { | ||
"kind": "Name", | ||
"value": "String" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"operation": "query", | ||
"selectionSet": { | ||
"kind": "SelectionSet", | ||
"selections": [ | ||
{ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "foo1" | ||
}, | ||
"arguments": [], | ||
"directives": [] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"loc": { | ||
"start": 0, | ||
"end": 27, | ||
"source": { | ||
"body": "query($foo: String!) {foo1}" | ||
} | ||
} | ||
}; |
55 changes: 55 additions & 0 deletions
55
tests/graphql_tag/definations/operation/unnamed_query/strip-output.js
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,55 @@ | ||
import gql from 'graphql-tag'; | ||
const foo = { | ||
"kind": "Document", | ||
"definitions": [ | ||
{ | ||
"kind": "OperationDefinition", | ||
"directives": [], | ||
"variableDefinitions": [ | ||
{ | ||
"kind": "VariableDefinition", | ||
"directives": [], | ||
"variable": { | ||
"kind": "Variable", | ||
"name": { | ||
"kind": "Name", | ||
"value": "foo" | ||
} | ||
}, | ||
"type": { | ||
"kind": "NonNullType", | ||
"type": { | ||
"kind": "NamedType", | ||
"name": { | ||
"kind": "Name", | ||
"value": "String" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"operation": "query", | ||
"selectionSet": { | ||
"kind": "SelectionSet", | ||
"selections": [ | ||
{ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "foo1" | ||
}, | ||
"arguments": [], | ||
"directives": [] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"loc": { | ||
"start": 0, | ||
"end": 25, | ||
"source": { | ||
"body": "query($foo:String!){foo1}" | ||
} | ||
} | ||
}; |
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
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