Name: graphql-import-loader
Owner: Prisma
Description: Webpack loader for `graphql-import`
Created: 2018-03-01 12:20:32.0
Updated: 2018-05-17 22:23:40.0
Pushed: 2018-05-24 00:40:01.0
Homepage: null
Size: 12
Language: TypeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Webpack loader for graphql-import
add --dev graphql-import-loader
Resolve GraphQL file import statements as a string. See the tests for more details
port { A } from 'src/schema/a.graphql'
port { B } from 'src/schema/b.graphql'
port { C, D } from 'src/schema/cd.graphql'
Complex {
: ID!
A!
B!
C!
D!
s
rt typeDefs from './schema.graphql'
s
ebpack.config.js
le.exports = {
dule: {
rules: [
{
exclude: /node_modules/,
test: /\.graphql$/,
use: [{ loader: 'graphql-import-loader' }]
}
]
Simple Server:
rt { GraphQLServer } from 'graphql-yoga'
rt resolvers from './resolvers'
rt typeDefs from './schema.graphql'
t server = new GraphQLServer({ typeDefs, resolvers })
er.start(() => console.log('Server running on :4000'))
Advanced:
serverless-prisma: Serverless starter kit using Prisma (early-stages)