I have imported my GraphQL schema already using the Fauna dashboard; however, I now made changes to my local schema.gql file and would like to import and merge this new updated local schema and overwrite the remote schema in FaunaDB.
I understand I must use this endpoint https://graphql.fauna.com/import for importing my local schema, but I am not sure how to do so.
For example, using ApolloServer, I know that I can connect the the Fauna’s graphql endpoint to make queries on my schema already present on my FaunaDB:
import { ApolloServer, makeRemoteExecutableSchema, introspectSchema } from 'apollo-server-micro'
import { HttpLink } from 'apollo-link-http'
import fetch from 'node-fetch'
const link = HttpLink({
uri: {
"https://graphql.fauna.com/graphql", fetch
},
headers: {
Authorization: `Bearer ${process.env.SERVER_KEY}`
}
})
const schema = makeRemoteExecutableSchema({
schema: introspectSchema(link),
link
})
const server = new ApolloServer({
schema,
introspection: true
})
export default server.createHandler({
path: 'api/apolloServer',
cors: {
origin: "*",
credentials: true
}
})
How do I import my schema in a similar manner using this with the https://graphql.fauna.com/import endpoint?