-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
4,111 additions
and
2,113 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
snapshot_tests/operations/errors/expected/fragmentTemplateTagNotFound.res.txt
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,17 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36msnapshot_tests/operations/errors/fragmentTemplateTagNotFound.res[0m:[2m11:3-15:3[0m | ||
|
||
9 [2m│[0m | ||
10 [2m│[0m %graphql(` | ||
[1;31m11[0m [2m│[0m [1;31mquery MyQuery @ppxConfig(templateTag: "gql", templateTagReturnType: "[0m | ||
[2m│[0m [1;31mbool") {[0m | ||
[1;31m12[0m [2m│[0m [1;31m lists {[0m | ||
[1;31m13[0m [2m│[0m [1;31m ...ListFragment[0m | ||
[1;31m14[0m [2m│[0m [1;31m }[0m | ||
[1;31m15[0m [2m│[0m [1;31m }[0m | ||
16 [2m│[0m `) | ||
17 [2m│[0m | ||
|
||
The value gql can't be found | ||
|
21 changes: 21 additions & 0 deletions
21
snapshot_tests/operations/errors/expected/fragmentTemplateTagWrongType.res.txt
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,21 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36msnapshot_tests/operations/errors/fragmentTemplateTagWrongType.res[0m:[2m11:10-21[0m | ||
|
||
9 [2m│[0m query MyQuery @ppxConfig(templateTagLocation: "gql", templateTagRetur | ||
[2m│[0m nType: "bool") { | ||
10 [2m│[0m lists { | ||
[1;31m11[0m [2m│[0m ...[1;31mListFragment[0m | ||
12 [2m│[0m } | ||
13 [2m│[0m } | ||
14 [2m│[0m `) | ||
|
||
This array item has type: [1;31mstring[0m | ||
But this array is expected to have items of type: [1;33mbool[0m | ||
|
||
Arrays can only contain items of the same type. | ||
|
||
Possible solutions: | ||
- Convert all values in the array to the same type. | ||
- Use a tuple, if your array is of fixed length. Tuples can mix types freely, and compiles to a JavaScript array. Example of a tuple: `let myTuple = (10, "hello", 15.5, true) | ||
|
21 changes: 21 additions & 0 deletions
21
snapshot_tests/operations/errors/expected/fragmentTemplateTagWrongTypeOnFragment.res.txt
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,21 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36msnapshot_tests/operations/errors/fragmentTemplateTagWrongTypeOnFragment.res[0m:[2m11:8-24[0m | ||
|
||
9 [2m│[0m fragment ListFragment on Lists @ppxConfig(templateTagLocation: "gql" | ||
[2m│[0m , templateTagReturnType: "bool") { | ||
10 [2m│[0m nullableOfNullable | ||
[1;31m11[0m [2m│[0m ...[1;31mListFragmentInner[0m | ||
12 [2m│[0m } | ||
13 [2m│[0m `) | ||
14 [2m│[0m | ||
|
||
This array item has type: [1;31mstring[0m | ||
But this array is expected to have items of type: [1;33mbool[0m | ||
|
||
Arrays can only contain items of the same type. | ||
|
||
Possible solutions: | ||
- Convert all values in the array to the same type. | ||
- Use a tuple, if your array is of fixed length. Tuples can mix types freely, and compiles to a JavaScript array. Example of a tuple: `let myTuple = (10, "hello", 15.5, true) | ||
|
14 changes: 14 additions & 0 deletions
14
...ot_tests/operations/errors/expected/fragmentTemplateTagWrongTypeOnFragmentReverse.res.txt
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,14 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36msnapshot_tests/operations/errors/fragmentTemplateTagWrongTypeOnFragmentReverse.res[0m:[2m11:8-24[0m | ||
|
||
9 [2m│[0m fragment ListFragment on Lists { | ||
10 [2m│[0m nullableOfNullable | ||
[1;31m11[0m [2m│[0m ...[1;31mListFragmentInner[0m | ||
12 [2m│[0m } | ||
13 [2m│[0m `) | ||
14 [2m│[0m | ||
|
||
This has type: [1;31mbool[0m | ||
But this function argument is expecting: [1;33mstring[0m | ||
|
14 changes: 14 additions & 0 deletions
14
snapshot_tests/operations/errors/expected/fragmentTemplateTagWrongTypeReverse.res.txt
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,14 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36msnapshot_tests/operations/errors/fragmentTemplateTagWrongTypeReverse.res[0m:[2m11:10-21[0m | ||
|
||
9 [2m│[0m query MyQuery { | ||
10 [2m│[0m lists { | ||
[1;31m11[0m [2m│[0m ...[1;31mListFragment[0m | ||
12 [2m│[0m } | ||
13 [2m│[0m } | ||
14 [2m│[0m `) | ||
|
||
This has type: [1;31mbool[0m | ||
But this function argument is expecting: [1;33mstring[0m | ||
|
20 changes: 20 additions & 0 deletions
20
snapshot_tests/operations/errors/expected/fragmentTemplateTagWrongTypes.res.txt
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,20 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36msnapshot_tests/operations/errors/fragmentTemplateTagWrongTypes.res[0m:[2m19:10-26[0m | ||
|
||
17 [2m│[0m lists { | ||
18 [2m│[0m ...ListFragment | ||
[1;31m19[0m [2m│[0m ...[1;31mListFragmentWrong[0m | ||
20 [2m│[0m } | ||
21 [2m│[0m } | ||
22 [2m│[0m `) | ||
|
||
This array item has type: [1;31mstring[0m | ||
But this array is expected to have items of type: [1;33mbool[0m | ||
|
||
Arrays can only contain items of the same type. | ||
|
||
Possible solutions: | ||
- Convert all values in the array to the same type. | ||
- Use a tuple, if your array is of fixed length. Tuples can mix types freely, and compiles to a JavaScript array. Example of a tuple: `let myTuple = (10, "hello", 15.5, true) | ||
|
16 changes: 16 additions & 0 deletions
16
snapshot_tests/operations/errors/fragmentTemplateTagNotFound.res
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,16 @@ | ||
%graphql(` | ||
fragment ListFragment on Lists { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
module WrongFragmentName = ListFragment | ||
|
||
%graphql(` | ||
query MyQuery @ppxConfig(templateTag: "gql", templateTagReturnType: "bool") { | ||
lists { | ||
...ListFragment | ||
} | ||
} | ||
`) |
14 changes: 14 additions & 0 deletions
14
snapshot_tests/operations/errors/fragmentTemplateTagWrongType.res
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,14 @@ | ||
%graphql(` | ||
fragment ListFragment on Lists { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
%graphql(` | ||
query MyQuery @ppxConfig(templateTagLocation: "gql", templateTagReturnType: "bool") { | ||
lists { | ||
...ListFragment | ||
} | ||
} | ||
`) |
13 changes: 13 additions & 0 deletions
13
snapshot_tests/operations/errors/fragmentTemplateTagWrongTypeOnFragment.res
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,13 @@ | ||
%graphql(` | ||
fragment ListFragmentInner on Lists { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
%graphql(` | ||
fragment ListFragment on Lists @ppxConfig(templateTagLocation: "gql", templateTagReturnType: "bool") { | ||
nullableOfNullable | ||
...ListFragmentInner | ||
} | ||
`) |
13 changes: 13 additions & 0 deletions
13
snapshot_tests/operations/errors/fragmentTemplateTagWrongTypeOnFragmentReverse.res
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,13 @@ | ||
%graphql(` | ||
fragment ListFragmentInner on Lists @ppxConfig(templateTagLocation: "gql", templateTagReturnType: "bool") { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
%graphql(` | ||
fragment ListFragment on Lists { | ||
nullableOfNullable | ||
...ListFragmentInner | ||
} | ||
`) |
14 changes: 14 additions & 0 deletions
14
snapshot_tests/operations/errors/fragmentTemplateTagWrongTypeReverse.res
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,14 @@ | ||
%graphql(` | ||
fragment ListFragment on Lists @ppxConfig(templateTagLocation: "gql", templateTagReturnType: "bool") { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
%graphql(` | ||
query MyQuery { | ||
lists { | ||
...ListFragment | ||
} | ||
} | ||
`) |
22 changes: 22 additions & 0 deletions
22
snapshot_tests/operations/errors/fragmentTemplateTagWrongTypes.res
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,22 @@ | ||
%graphql(` | ||
fragment ListFragment on Lists @ppxConfig(templateTagLocation: "gql", templateTagReturnType: "bool") { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
%graphql(` | ||
fragment ListFragmentWrong on Lists { | ||
nullableOfNullable | ||
nullableOfNonNullable | ||
} | ||
`) | ||
|
||
%graphql(` | ||
query MyQuery @ppxConfig(templateTagLocation: "gql", templateTagReturnType: "bool") { | ||
lists { | ||
...ListFragment | ||
...ListFragmentWrong | ||
} | ||
} | ||
`) |
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
113 changes: 113 additions & 0 deletions
113
snapshot_tests/operations/expected/apollo/compile/fragmentWithdifferentReturnType.res.txt
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,113 @@ | ||
// Generated by ReScript, PLEASE EDIT WITH CARE | ||
'use strict'; | ||
|
||
var Gql = require("gql").default; | ||
|
||
var Raw = {}; | ||
|
||
var query = "fragment ListFragment on Lists {\n__typename \nnullableOfNullable \nnullableOfNonNullable \n}\n"; | ||
|
||
function parse(value) { | ||
var value$1 = value.nullableOfNullable; | ||
var value$2 = value.nullableOfNonNullable; | ||
return { | ||
__typename: value.__typename, | ||
nullableOfNullable: !(value$1 == null) ? value$1.map(function (value) { | ||
if (!(value == null)) { | ||
return value; | ||
} | ||
|
||
}) : undefined, | ||
nullableOfNonNullable: !(value$2 == null) ? value$2.map(function (value) { | ||
return value; | ||
}) : undefined | ||
}; | ||
} | ||
|
||
function serialize(value) { | ||
var value$1 = value.nullableOfNonNullable; | ||
var nullableOfNonNullable = value$1 !== undefined ? value$1.map(function (value) { | ||
return value; | ||
}) : null; | ||
var value$2 = value.nullableOfNullable; | ||
var nullableOfNullable = value$2 !== undefined ? value$2.map(function (value) { | ||
if (value !== undefined) { | ||
return value; | ||
} else { | ||
return null; | ||
} | ||
}) : null; | ||
var value$3 = value.__typename; | ||
return { | ||
__typename: value$3, | ||
nullableOfNullable: nullableOfNullable, | ||
nullableOfNonNullable: nullableOfNonNullable | ||
}; | ||
} | ||
|
||
function verifyArgsAndParse(_ListFragment, value) { | ||
return parse(value); | ||
} | ||
|
||
function verifyName(param) { | ||
|
||
} | ||
|
||
var ListFragment = { | ||
Raw: Raw, | ||
query: query, | ||
parse: parse, | ||
serialize: serialize, | ||
verifyArgsAndParse: verifyArgsAndParse, | ||
verifyName: verifyName | ||
}; | ||
|
||
var Raw$1 = {}; | ||
|
||
var query$1 = Gql`query MyQuery { | ||
lists { | ||
...ListFragment @ppxAllowStringReturnType | ||
} | ||
|
||
} | ||
${query}`; | ||
|
||
function parse$1(value) { | ||
return { | ||
lists: parse(value.lists) | ||
}; | ||
} | ||
|
||
function serialize$1(value) { | ||
var value$1 = value.lists; | ||
var lists = serialize(value$1); | ||
return { | ||
lists: lists | ||
}; | ||
} | ||
|
||
function serializeVariables(param) { | ||
|
||
} | ||
|
||
function makeVariables(param) { | ||
|
||
} | ||
|
||
function makeDefaultVariables(param) { | ||
|
||
} | ||
|
||
var MyQuery = { | ||
Raw: Raw$1, | ||
query: query$1, | ||
parse: parse$1, | ||
serialize: serialize$1, | ||
serializeVariables: serializeVariables, | ||
makeVariables: makeVariables, | ||
makeDefaultVariables: makeDefaultVariables | ||
}; | ||
|
||
exports.ListFragment = ListFragment; | ||
exports.MyQuery = MyQuery; | ||
/* query Not a pure module */ |
Oops, something went wrong.