在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):prisma-labs/graphql-import-loader开源软件地址(OpenSource Url):https://github.com/prisma-labs/graphql-import-loader开源编程语言(OpenSource Language):TypeScript 89.2%开源软件介绍(OpenSource Introduction):graphql-import-loaderWebpack loader for Installyarn add --dev graphql-import-loader UsageResolve GraphQL file import statements as a string. See the tests for more details # import { A } from 'src/schema/a.graphql'
# import { B } from 'src/schema/b.graphql'
# import { C, D } from 'src/schema/cd.graphql'
type Complex {
id: ID!
a: A!
b: B!
c: C!
d: D!
} import typeDefs from './schema.graphql' // webpack.config.js
module.exports = {
module: {
rules: [
{
exclude: /node_modules/,
test: /\.graphql$/,
use: [{ loader: 'graphql-import-loader' }]
}
]
}
} ExamplesSimple Server: import { GraphQLServer } from 'graphql-yoga'
import resolvers from './resolvers'
import typeDefs from './schema.graphql'
const server = new GraphQLServer({ typeDefs, resolvers })
server.start(() => console.log('Server running on :4000')) Advanced: serverless-prisma: Serverless starter kit using Prisma (early-stages) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论