Open datanexus-vincent opened 1 year ago
this subgraph seems to not be returning valid introspection result https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2
Hey Saihaj, appreciate the response!
Unfortunately, I'm not sure that is the true source of the issue. I copied the .graphclientrc.yml
file and the example query from the example project https://github.com/graphprotocol/graph-client/tree/main/examples/apollo which successfully builds the local .graphclient
package without any introspection result errors.
From what I can tell the only inputs for building the local .graphclient
package are the .graphclientrc.yml
file and any query files you have linked in there. Is there anything else I can configure that would give me a different result when using the same .graphclientrc.yml
and query files between different projects?
Hey @datanexus-vincent, if I remember correctly, the Compound V2 subgraph was manually enhanced on the hosted service with query-time computation as seen here: https://github.com/graphprotocol/compound-subgraph-wrapper. It might be that this manual change messed up with the schema introspection as @saihaj pointed out. I did not check myself.
I suggest that you use the one developed by Messari here: https://thegraph.com/explorer/subgraphs/6tGbL7WBx287EZwGUvvcQdL6m67JGMJrma3JSTtt5SV7?view=Overview&chain=mainnet
The enhancements done manually on Compound V2 should be reproducible with Graph Client. Let us know if you try to do this and how it goes.
Hey @schmidsi, appreciate you jumping in on this.
I'm actually not even really interested in using the Compound V2 subgraph. I just wanted to create an example Vue 3/Apollo project that I could submit a pull request for so that I and others could better understand how all of these pieces work together, and so I used the same graph client config and example query as the React/Apollo example. But, for some reason, while the local graph client compiles just fine for the React/Apollo example, it doesn't compile with my implementation. At this point, I'm just trying to figure out why a graph client config and example query works in one project and not another.
Here is the debug output of a successful compile for the React/Apollo example in the graph client repo, which uses the exact same graph client config and example query as my example project. Do you have any idea why it might work in one project but not another?
yarn run v1.22.15
$ graphclient build
π‘ GraphClient Cleaning existing artifacts
π‘ GraphClient Reading the configuration
@graphql-tools/load: normalizePointers ./src/example-query.graphql: 0.087ms
@graphql-tools/load: normalizePointers: 0.255ms
@graphql-tools/load: collectDocumentString ./src/example-query.graphql: 0.066ms
@graphql-tools/load: collectSources ./src/example-query.graphql: 0.3ms
@graphql-tools/load: loadFile ./src/example-query.graphql: 10.733ms
@graphql-tools/load: collectFallback ./src/example-query.graphql: 10.955ms
@graphql-tools/load: collectSources queue: 29.082ms
@graphql-tools/load: parseSchema /home/vincenttaglia/WebstormProjects/graph-client/examples/apollo/src/example-query.graphql: 0.008ms
@graphql-tools/load: parseRawSDL /home/vincenttaglia/WebstormProjects/graph-client/examples/apollo/src/example-query.graphql: 0.067ms
@graphql-tools/load: useComments /home/vincenttaglia/WebstormProjects/graph-client/examples/apollo/src/example-query.graphql: 1.447ms
@graphql-tools/load: collectValidSources /home/vincenttaglia/WebstormProjects/graph-client/examples/apollo/src/example-query.graphql: 0.017ms
@graphql-tools/load: parseSource /home/vincenttaglia/WebstormProjects/graph-client/examples/apollo/src/example-query.graphql: 2.117ms
@graphql-tools/load: prepareResult: 0.005ms
@graphql-tools/load: loadTypedefs: 32.678ms
π‘ GraphClient Generating the unified schema
π GraphClient - GetMesh Getting subschemas from source handlers
π GraphClient - uniswapv2 Generating the schema
π GraphClient - compoundv2 Generating the schema
π GraphClient - uniswapv2 The schema has been generated successfully
π GraphClient - uniswapv2 Analyzing transforms
π GraphClient - compoundv2 The schema has been generated successfully
π GraphClient - compoundv2 Analyzing transforms
π GraphClient - GetMesh Schemas have been generated by the source handlers
π GraphClient - GetMesh Merging schemas using the defined merging strategy.
π GraphClient - stitchingMerger Stitching directives are being generated
π GraphClient - stitchingMerger Checking if any of sources has federation metadata
π GraphClient - stitchingMerger Stitching the source schemas
π GraphClient - stitchingMerger sourceMap is being generated and attached to the unified schema
Transformed schema is not set yet. Returning a dummy one.
π‘ GraphClient Generating artifacts
π‘ GraphClient Generating index file in TypeScript
π‘ GraphClient Writing index.ts for ESM to the disk.
π‘ GraphClient Cleanup
π‘ GraphClient Done! => /home/vincenttaglia/WebstormProjects/graph-client/examples/apollo/.graphclient
Done in 3.91s.
I'm getting this error when I build my local graphclient package:
What am I missing in my Vue 3 / Apollo 3 / TypeScript implementation? The react example with the same graph client config and example query compiles just fine so that leads me to believe it might be a tsconfig misconfiguration, but I can't seem to nail it down. Any help would be much appreciated, thank you!
My repository: https://github.com/datanexus-vincent/graph-client-vue3-apollo-example
Full debug log: