You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
I am trying to reproduce the README example of apollo-link-schema for mocking purposes and I get the following TypeScript error:
Type 'SchemaLink' is missing the following properties from type 'ApolloLink': onError, setOnError
ApolloClient.d.ts(22, 5): The expected type comes from property 'link' which is declared here on type 'ApolloClientOptions<NormalizedCacheObject>'
// From https://www.apollographql.com/docs/graphql-tools/generate-schema/#exampleexportdefault` type Author { id: Int! firstName: String lastName: String """ the list of Posts by this author """ posts: [Post] } type Post { id: Int! title: String author: Author votes: Int } # the schema allows the following query: type Query { posts: [Post] author(id: Int!): Author } # this schema allows the following mutation: type Mutation { upvotePost(postId: Int!): Post }`
package.json:
// Some fields omitted{"dependencies": {"@apollo/client": "^3.0.0-beta.41",// <-- Could that be the issue?"@types/jest": "^24.9.1","@types/node": "^12.12.28","@types/react": "^16.9.23","@types/react-dom": "^16.9.5","apollo-link-schema": "^1.2.4",// <-- You are here"graphql-tools": "^4.0.7","react": "^16.13.0","react-dom": "^16.13.0","react-scripts": "3.4.0","typescript": "^3.7.5"},"devDependencies": {"apollo": "^2.25.0",}}
The text was updated successfully, but these errors were encountered:
Because there isn't enough overlap, simply typing it as ApolloLink won't work. This seems to be an issue with the typing in either apollo-link-schema or @apollo/client. I'm getting the same issue, my temporary fix is to cast to unknown and then ApolloLink:
Hello,
I am trying to reproduce the README example of apollo-link-schema for mocking purposes and I get the following TypeScript error:
for the line:
Is this a bug or am I doing something wrong?
Thank you!
The text was updated successfully, but these errors were encountered: