Skip to content

Instantly share code, notes, and snippets.

@aswinmprabhu
Last active August 17, 2018 12:34
Show Gist options
  • Save aswinmprabhu/61829a0197e48f227651b33b64d1d8e2 to your computer and use it in GitHub Desktop.
Save aswinmprabhu/61829a0197e48f227651b33b64d1d8e2 to your computer and use it in GitHub Desktop.
import {
makeRemoteExecutableSchema,
introspectSchema,
} from 'graphql-tools';
import fetch from 'node-fetch';
import { HttpLink } from 'apollo-link-http';
// To satisfy Extend peer dependencies
import 'apollo-link';
const createRemoteExecutableSchema = async () => {
// Create remote executable user schema
const userLink = new HttpLink({
uri: 'https://bazookaand.herokuapp.com/v1alpha1/graphql',
fetch,
});
const userSchema = makeRemoteExecutableSchema({
schema: await introspectSchema(userLink),
link: userLink,
});
return userSchema;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment