作者:李巍shelton | 来源:互联网 | 2023-09-05 10:49
本文由编程笔记#小编为大家整理,主要介绍了Javascript Subindo Apollo服务器相关的知识,希望对你有一定的参考价值。
const { ApolloServer, gql } = require('apollo-server')
const { importSchema } = require('graphql-import')
const resolvers = require('./resolvers')
const schemaPath = './schema/index.graphql'
const server = new ApolloServer({
typeDefs: importSchema(schemaPath),
resolvers
})
server.listen().then(({ url }) => {
console.log(`Executando em ${url}`)
})