Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
]
}
}
});
// The object id retrieved is already unique, it's actually
// ObjectType:primaryKey encoded in base64, so we define our
// own dataIdFromObject instead of using the default one `${o.__typename}:o.id`.
// This allows us to define a custom resolver for the node query.
// for more info about customResolvers, read
// http://dev.apollodata.com/react/query-splitting.html
const dataIdFromObject = o => o.id;
const networkInterface = createNetworkInterface({
uri: getFullPath('graphql', { slug: getDiscussionSlug() }),
opts: {
credentials: 'same-origin'
}
});
// trace every graphql operation in sentry
networkInterface.use([
{
applyMiddleware: function (req, next) {
Sentry.addBreadcrumb({
category: 'graphql',
message: `GraphQL operation: ${req.request.operationName}`,
data: {
variables: req.request.variables
},