File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { makeExecutableSchema } from "@graphql-tools/schema";
2
2
import gql from "graphql-tag" ;
3
3
import { typeDefs as scalarTypeDefs } from "./types/scalars" ;
4
4
import { typeDefs as relayTypeDefs } from "./types/relay" ;
5
+ import { typeDefs as externalSourceTypeDefs } from "./types/externalSource" ;
5
6
import { typeDefs as documentTypeDefs } from "./types/document" ;
6
7
import { typeDefs as searchResultTypeDefs } from "./types/searchResult" ;
7
8
@@ -22,6 +23,7 @@ export const schema = makeExecutableSchema({
22
23
typeDefs ,
23
24
...scalarTypeDefs ,
24
25
...relayTypeDefs ,
26
+ externalSourceTypeDefs ,
25
27
documentTypeDefs ,
26
28
searchResultTypeDefs ,
27
29
] ,
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ const { connectionType: DocumentConnection } = connectionDefinitions({
8
8
export const typeDefs = gql `
9
9
type Document implements Node {
10
10
id: ID!
11
+ name: String!
11
12
url: URL!
13
+ externalSource: ExternalSource!
12
14
}
13
15
14
16
${ DocumentConnection }
Original file line number Diff line number Diff line change
1
+ import { connectionArgs , connectionDefinitions } from "graphql-relay-tools" ;
2
+ import gql from "graphql-tag" ;
3
+
4
+ const { connectionType : ExternalSourceConnection } = connectionDefinitions ( {
5
+ name : "ExternalSource" ,
6
+ } ) ;
7
+
8
+ export const typeDefs = gql `
9
+ type ExternalSource implements Node {
10
+ id: ID!
11
+ name: String!
12
+ description: String!
13
+ url: URL!
14
+ }
15
+
16
+ ${ ExternalSourceConnection }
17
+
18
+ extend type Query {
19
+ externalSources${ connectionArgs ( ) } : ExternalSourceConnection!
20
+ }
21
+ ` ;
You can’t perform that action at this time.
0 commit comments