Skip to content

@apollo/client v4 and ra-data-graphql compatibility #10971

@ThHareau

Description

@ThHareau

I am trying to use buildGraphQLProvider with @apollo/client 4.0.6 which doesn't seem to be compatible with ra-data-graphql.

Here is my snippet:

const client = new ApolloClient({
  cache: new InMemoryCache(),
  link: new HttpLink(),
});

const buildQuery = () => () => {
  return {
    query: gql``,
    variables: {},
    parseResponse: (response: unknown) => response,
  };
};

buildGraphQLProvider({ client, buildQuery });

with @apollo/client in version 4.0.6 and ra-data-graphql in version 5.11.4.

I'm having the following issue:

error TS2739: Type 'ApolloClient' is missing the following properties from type 'ApolloClient<unknown>': typeDefs, addResolvers, setResolvers, getResolvers, setLocalStateFragmentMatcher

This happens because ra-data-graphql is expecting an ApolloClient v3 whereas I provide an ApolloClient v4.

Are you planning to support version 4 from ApolloClient ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions