Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'chainName' does not exist in type 'MeshContext' | cross-chain-extension #286

Open
vlad1chek opened this issue Oct 11, 2022 · 2 comments
Open

Comments

@vlad1chek
Copy link

Hello there!
I found the bug in latest versions of @graphprotocol/client-cli and @graphprotocol/client-add-source-name. When I try to implement cross-chain query like in your example I can't build my project because I get typescript error:

Type '{ chainName: string; sushiswap: { Query: SushiswapTypes.QuerySdk; Mutation: SushiswapTypes.MutationSdk; Subscription: SushiswapTypes.SubscriptionSdk; }; [MESH_CONTEXT_SYMBOL]: true; pubsub: MeshPubSub; cache: KeyValueCache<...>; logger: Logger; }' is not assignable to type 'MeshContext'.
  Object literal may only specify known properties, and 'chainName' does not exist in type 'MeshContext'.

I did small investigation and found out that all works fine with old versions:

"@graphprotocol/client-add-source-name": "1.0.2",
"@graphprotocol/client-cli": "2.1.1",

Also, you can check the example of the error in codesandbox https://codesandbox.io/s/musing-zhukovsky-2mzu0f?file=/resolvers.ts
image

@ardatan
Copy link
Member

ardatan commented Oct 11, 2022

@vlad1chek
Copy link
Author

I have it, but it doesn't help. I checked types in .graphclient folder and the context indeed has chainName. But for some reason, this error still exists.

export type Context = {
      ["sushiswap"]: { Query: QuerySdk, Mutation: MutationSdk, Subscription: SubscriptionSdk },
      ["chainName"]: Scalars['ID']
    };

Codesandbox example also has this line in .graphclientrc.yml but the error persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants