-
Notifications
You must be signed in to change notification settings - Fork 15
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
1 parent
3be18ba
commit 589b9a0
Showing
11 changed files
with
139 additions
and
16 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
6 changes: 6 additions & 0 deletions
6
src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts
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,6 @@ | ||
// {"schemaHeader": ["Hello", 1]} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected
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 @@ | ||
----------------- | ||
INPUT | ||
----------------- | ||
// {"schemaHeader": ["Hello", 1]} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} | ||
|
||
----------------- | ||
OUTPUT | ||
----------------- | ||
Grats: If the Grats config option `schemaHeader` is an array, it must be an array of strings. |
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,6 @@ | ||
// {"invalidKey": "Oops"} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected
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 @@ | ||
----------------- | ||
INPUT | ||
----------------- | ||
// {"invalidKey": "Oops"} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} | ||
|
||
----------------- | ||
OUTPUT | ||
----------------- | ||
Grats: Unknown Grats config option `invalidKey` |
6 changes: 6 additions & 0 deletions
6
src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts
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,6 @@ | ||
// {"invalidKey": "Oops", "anotherInvalidKey": "Oops"} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected
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 @@ | ||
----------------- | ||
INPUT | ||
----------------- | ||
// {"invalidKey": "Oops", "anotherInvalidKey": "Oops"} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} | ||
|
||
----------------- | ||
OUTPUT | ||
----------------- | ||
Grats: Unknown Grats config option `invalidKey` |
6 changes: 6 additions & 0 deletions
6
src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts
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,6 @@ | ||
// {"tsSchema": null} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} |
35 changes: 35 additions & 0 deletions
35
src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected
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,35 @@ | ||
----------------- | ||
INPUT | ||
----------------- | ||
// {"tsSchema": null} | ||
/** @gqlType */ | ||
export default class SomeType { | ||
/** @gqlField */ | ||
hello: string; | ||
} | ||
|
||
----------------- | ||
OUTPUT | ||
----------------- | ||
-- SDL -- | ||
type SomeType { | ||
hello: String @metadata | ||
} | ||
-- TypeScript -- | ||
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; | ||
export function getSchema(): GraphQLSchema { | ||
const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ | ||
name: "SomeType", | ||
fields() { | ||
return { | ||
hello: { | ||
name: "hello", | ||
type: GraphQLString | ||
} | ||
}; | ||
} | ||
}); | ||
return new GraphQLSchema({ | ||
types: [SomeTypeType] | ||
}); | ||
} |
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