Skip to content

cassidycodes/graphql-server-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphqQL Sample App with @private Directive

Installation

yarn install

Public Mode

Run in public mode:

PRIVATE_DEPLOYMENT=false yarn serve

NOTE: PRIVATE_DEPLOYMENT is an optional argument. If it is not included, @private objects and fields will be excluded.

Example Public Schema

directive @private on OBJECT | FIELD_DEFINITION | ENUM

directive @public on OBJECT | FIELD_DEFINITION | ENUM

type Client {
  fullName: String
}

type Query {
  clients: [Client]
}

Private Mode

Run in internal mode:

PRIVATE_DEPLOYMENT=true yarn serve

Example Private Schema

directive @private on OBJECT | FIELD_DEFINITION | ENUM

directive @public on OBJECT | FIELD_DEFINITION | ENUM

type Client {
  fullName: String
  secretField: String
}

enum SecretEnum {
  ONE
  TWO
  THREE
}

type SecretThing {
  shhh: String
}

type Query {
  clients: [Client]
  secretThings: [SecretThing]
}

About

Example for filtering a directive from the schema

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published