import-graphql
Install
NPM
npm install import-graphql --save
YARN
yarn add import-graphql
Usage
defs.ts
;; ; ;
Assume the following directory structure:
types/
├── schema.graphql
└── message.graphql
schema.graphql
schema { query: Query} type Query { messages: [Message]} type Mutation { mark_read_all: ResponseStatus!} type ResponseStatus { status: Boolean!}
message.graphql
type Message { id: String! title: String! content: String!}extend type Mutation { create_message( title: String! content: String! ): Message}
schema.ts
;; ; ;