prismagraphql/graphql-import-loader

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

graphql-import-loader

CircleCI npm version

Webpack loader for graphql-import

Install
 add --dev graphql-import-loader
Usage

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' }]
  }
]


Examples

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)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.