How to use the ra-data-graphql-simple.default function in ra-data-graphql-simple

To help you get started, we’ve selected a few ra-data-graphql-simple examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mgm-interns / team-radio / admin / src / dataProvider / graphql.ts View on Github external
case 'songs':
        return 'Song';

      case 'playlistSongs':
        return 'PlaylistSong';

      case 'historySongs':
        return 'HistorySong';

      default:
        throw new Error(`Unknown resource ${resource}`);
    }
  };

  return buildApolloClient({
    clientOptions: {
      link: authLink.concat(httpLink),
      cache: new InMemoryCache()
    }
  })
    .then((dataProvider: any) => (type: any, resource: string, params: any) =>
      dataProvider(type, getGqlResource(resource), params)
    )
    .catch(() => {
      localStorage.clear();
      window.location.reload();
    });
};

ra-data-graphql-simple

A GraphQL simple data provider for react-admin

MIT
Latest version published 2 days ago

Package Health Score

93 / 100
Full package analysis