TypeScript & GraphQL types for use with Nacelle products
npm i @nacelle/types
This package exports GraphQL type definitions which can be merged with type definitions in another project.
import { sharedTypeDefs } from '@nacelle/types';
import { mergeTypeDefs } from '@graphql-tools/merge';
import { typeDefs } from './src/your/type/defs';
const schema = makeExecutableSchema({
typeDefs: mergeTypeDefs([sharedTypeDefs, typeDefs]),
resolvers
});
To generate TypeScript interfaces from the GraphQL type defintions, run npm run generate
.
import { NacelleProduct } from '@nacelle/types';
const product: NacelleProduct = { ... };
ISC © getnacelle