Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case 'commands':
return 'Command';
case 'products':
return 'Product';
case 'reviews':
return 'Review';
default:
throw new Error(`Unknown resource ${resource}`);
}
};
return buildApolloClient({
clientOptions: {
uri: 'http://localhost:4000/graphql',
},
}).then(dataProvider => (type, resource, params) =>
dataProvider(type, getGqlResource(resource), params)
);
};
export default () => {
return buildApolloClient({
clientOptions: {
uri: 'http://localhost:4000/graphql',
},
introspection: {
operationNames: {
[DELETE]: resource => `remove${resource.name}`
}
},
buildQuery: customBuildQuery
}).then(dataProvider => (type, resource, params) =>
dataProvider(type, getGqlResource(resource), params)
);
};