-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmesh.config.ts
44 lines (43 loc) · 1.27 KB
/
mesh.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig, loadGraphQLHTTPSubgraph } from '@graphql-mesh/compose-cli'
import { loadJSONSchemaSubgraph } from '@omnigraph/json-schema'
export const composeConfig = defineConfig({
subgraphs: [
{
sourceHandler: loadGraphQLHTTPSubgraph('IPSeeds', {
endpoint: 'https://subgraph.satsuma-prod.com/742d8952ab24/molecule--4039244/moleculexyz_ipseed/api'
})
},
{
sourceHandler: loadJSONSchemaSubgraph('CatalystProjects', {
endpoint: 'https://catalyst.molecule.xyz/api/',
operations: [
{
type: 'Query',
field: 'catalystMetadata',
path: '/projects?tokenId={args.id}',
method: 'GET',
responseSample: './jsons/CatalystProject.response.json',
responseTypeName: 'CatalystProject',
argTypeMap: {
id: {
type: 'string'
}
}
}
]
})
}
],
additionalTypeDefs: `
extend type IPSeed {
projectData: CatalystProject
@resolveTo(
sourceName: "CatalystProjects"
sourceTypeName: "Query"
sourceFieldName: "catalystMetadata"
requiredSelectionSet: "{ id }"
sourceArgs: { id: "{root.id}" }
)
}
`
})