Skip to content

Commit f5dfa8c

Browse files
committed
Add test for schema only using directives
1 parent ca6401d commit f5dfa8c

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
directive @semanticNonNull(levels: [Int!]) on FIELD_DEFINITION
2+
3+
type Query {
4+
allThings(includingArchived: Boolean, first: Int!): ThingConnection
5+
@semanticNonNull
6+
}
7+
8+
type ThingConnection {
9+
pageInfo: PageInfo!
10+
nodes: [Thing] @semanticNonNull(levels: [0, 1])
11+
}
12+
13+
type PageInfo {
14+
startCursor: String @semanticNonNull(levels: [0])
15+
endCursor: String @semanticNonNull
16+
hasNextPage: Boolean @semanticNonNull
17+
hasPreviousPage: Boolean @semanticNonNull
18+
}
19+
20+
interface Thing {
21+
id: ID!
22+
name: String @semanticNonNull
23+
description: String
24+
}
25+
26+
type Book implements Thing {
27+
id: ID!
28+
name: String @semanticNonNull
29+
description: String
30+
# Test that this non-null gets stripped
31+
pages: Int! @semanticNonNull
32+
}
33+
34+
type Car implements Thing {
35+
id: ID!
36+
name: String @semanticNonNull
37+
description: String
38+
mileage: Float @semanticNonNull
39+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
type Query {
2+
allThings(includingArchived: Boolean, first: Int!): ThingConnection
3+
}
4+
5+
type ThingConnection {
6+
pageInfo: PageInfo!
7+
nodes: [Thing]
8+
}
9+
10+
type PageInfo {
11+
startCursor: String
12+
endCursor: String
13+
hasNextPage: Boolean
14+
hasPreviousPage: Boolean
15+
}
16+
17+
interface Thing {
18+
id: ID!
19+
name: String
20+
description: String
21+
}
22+
23+
type Book implements Thing {
24+
id: ID!
25+
name: String
26+
description: String
27+
pages: Int
28+
}
29+
30+
type Car implements Thing {
31+
id: ID!
32+
name: String
33+
description: String
34+
mileage: Float
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
type Query {
2+
allThings(includingArchived: Boolean, first: Int!): ThingConnection!
3+
}
4+
5+
type ThingConnection {
6+
pageInfo: PageInfo!
7+
nodes: [Thing!]!
8+
}
9+
10+
type PageInfo {
11+
startCursor: String!
12+
endCursor: String!
13+
hasNextPage: Boolean!
14+
hasPreviousPage: Boolean!
15+
}
16+
17+
interface Thing {
18+
id: ID!
19+
name: String!
20+
description: String
21+
}
22+
23+
type Book implements Thing {
24+
id: ID!
25+
name: String!
26+
description: String
27+
pages: Int!
28+
}
29+
30+
type Car implements Thing {
31+
id: ID!
32+
name: String!
33+
description: String
34+
mileage: Float!
35+
}

0 commit comments

Comments
 (0)