-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(compiler): implicit schema definition snapshot tests
- Loading branch information
1 parent
f1dffd1
commit 5065bc7
Showing
12 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
crates/apollo-compiler/test_data/diagnostics/0108_implicit_schema_extension.graphql
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,7 @@ | ||
type Query { | ||
name: String | ||
} | ||
|
||
extend schema { | ||
query: Query | ||
} |
8 changes: 8 additions & 0 deletions
8
crates/apollo-compiler/test_data/diagnostics/0108_implicit_schema_extension.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,8 @@ | ||
Error: duplicate definitions for the `query` root operation type | ||
╭─[0108_implicit_schema_extension.graphql:6:5] | ||
│ | ||
6 │ query: Query | ||
│ ──────┬───── | ||
│ ╰─────── `query` redefined here | ||
───╯ | ||
|
3 changes: 3 additions & 0 deletions
3
crates/apollo-compiler/test_data/ok/0035_implicit_schema_definition_with_query_type.graphql
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 @@ | ||
type Query { | ||
name: String | ||
} |
18 changes: 18 additions & 0 deletions
18
crates/apollo-compiler/test_data/ok/0035_implicit_schema_definition_with_query_type.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,18 @@ | ||
0..31 @34 ObjectTypeDefinition { | ||
description: None, | ||
name: "Query", | ||
implements_interfaces: [], | ||
directives: [], | ||
fields: [ | ||
17..29 @34 FieldDefinition { | ||
description: None, | ||
name: "name", | ||
arguments: [], | ||
ty: Named( | ||
"String", | ||
), | ||
directives: [], | ||
}, | ||
], | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
...-compiler/test_data/ok/0036_implicit_schema_definition_with_several_default_types.graphql
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,12 @@ | ||
type Query { | ||
name: String | ||
} | ||
|
||
type Mutation { | ||
add(name: String!): Result! | ||
} | ||
|
||
type Result { | ||
id: String | ||
} | ||
|
62 changes: 62 additions & 0 deletions
62
...ollo-compiler/test_data/ok/0036_implicit_schema_definition_with_several_default_types.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,62 @@ | ||
0..31 @35 ObjectTypeDefinition { | ||
description: None, | ||
name: "Query", | ||
implements_interfaces: [], | ||
directives: [], | ||
fields: [ | ||
17..29 @35 FieldDefinition { | ||
description: None, | ||
name: "name", | ||
arguments: [], | ||
ty: Named( | ||
"String", | ||
), | ||
directives: [], | ||
}, | ||
], | ||
} | ||
33..81 @35 ObjectTypeDefinition { | ||
description: None, | ||
name: "Mutation", | ||
implements_interfaces: [], | ||
directives: [], | ||
fields: [ | ||
52..79 @35 FieldDefinition { | ||
description: None, | ||
name: "add", | ||
arguments: [ | ||
56..69 @35 InputValueDefinition { | ||
description: None, | ||
name: "name", | ||
ty: 62..69 @35 NonNullNamed( | ||
"String", | ||
), | ||
default_value: None, | ||
directives: [], | ||
}, | ||
], | ||
ty: NonNullNamed( | ||
"Result", | ||
), | ||
directives: [], | ||
}, | ||
], | ||
} | ||
83..111 @35 ObjectTypeDefinition { | ||
description: None, | ||
name: "Result", | ||
implements_interfaces: [], | ||
directives: [], | ||
fields: [ | ||
99..109 @35 FieldDefinition { | ||
description: None, | ||
name: "id", | ||
arguments: [], | ||
ty: Named( | ||
"String", | ||
), | ||
directives: [], | ||
}, | ||
], | ||
} | ||
|
6 changes: 6 additions & 0 deletions
6
crates/apollo-compiler/test_data/ok/0037_implicit_schema_extension_with_directive.graphql
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 @@ | ||
type Query { | ||
name: String | ||
} | ||
|
||
extend schema @dir | ||
directive @dir on SCHEMA |
36 changes: 36 additions & 0 deletions
36
crates/apollo-compiler/test_data/ok/0037_implicit_schema_extension_with_directive.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,36 @@ | ||
0..31 @36 ObjectTypeDefinition { | ||
description: None, | ||
name: "Query", | ||
implements_interfaces: [], | ||
directives: [], | ||
fields: [ | ||
17..29 @36 FieldDefinition { | ||
description: None, | ||
name: "name", | ||
arguments: [], | ||
ty: Named( | ||
"String", | ||
), | ||
directives: [], | ||
}, | ||
], | ||
} | ||
33..51 @36 SchemaExtension { | ||
directives: [ | ||
47..51 @36 Directive { | ||
name: "dir", | ||
arguments: [], | ||
}, | ||
], | ||
root_operations: [], | ||
} | ||
52..76 @36 DirectiveDefinition { | ||
description: None, | ||
name: "dir", | ||
arguments: [], | ||
repeatable: false, | ||
locations: [ | ||
"SCHEMA", | ||
], | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
...s/apollo-compiler/test_data/serializer/diagnostics/0108_implicit_schema_extension.graphql
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,7 @@ | ||
type Query { | ||
name: String | ||
} | ||
|
||
extend schema { | ||
query: Query | ||
} |
3 changes: 3 additions & 0 deletions
3
...-compiler/test_data/serializer/ok/0035_implicit_schema_definition_with_query_type.graphql
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 @@ | ||
type Query { | ||
name: String | ||
} |
11 changes: 11 additions & 0 deletions
11
...est_data/serializer/ok/0036_implicit_schema_definition_with_several_default_types.graphql
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,11 @@ | ||
type Query { | ||
name: String | ||
} | ||
|
||
type Mutation { | ||
add(name: String!): Result! | ||
} | ||
|
||
type Result { | ||
id: String | ||
} |
7 changes: 7 additions & 0 deletions
7
...lo-compiler/test_data/serializer/ok/0037_implicit_schema_extension_with_directive.graphql
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,7 @@ | ||
type Query { | ||
name: String | ||
} | ||
|
||
extend schema @dir | ||
|
||
directive @dir on SCHEMA |