prisma-labs / graphql-framework-experiment

Code-First Type-Safe GraphQL Framework
https://nexusjs.org
MIT License
674 stars 66 forks source link

SDL Generation in Nexus Framework #763

Closed OliverEvans96 closed 4 years ago

OliverEvans96 commented 4 years ago

Perceived Problem

Getting the SDL from a Nexus Framework graph seems to require running the server and downloading the schema from the playground. This makes schema stitching and/or connecting the frontend rather clunky.

Ideas / Proposed Solution(s)

Make an optional flag to generate schema.graphl at build time as in @nexus/schema

Weakky commented 4 years ago

Hey Oliver, have you tried the following?

import { settings } from 'nexus'
settings.change({
  schema: {
    generateGraphQLSDLFile: './schema.graphql',
  },
})
OliverEvans96 commented 4 years ago

Brilliant, that's exactly what I was looking for! Thanks!

jasonkuhrt commented 4 years ago

https://www.nexusjs.org/#/api/modules/main/exports/settings?id=schemagenerategraphqlsdlfile