#10971·react-admin

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

Author: ThHareauCreated Sep 26, 2025Updated Sep 26, 2025

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:

typescript
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 ?