Sails.js hook to integrate sails models with GraysQL. This hooks allows us to create a GraphQL schema using GraysQL from the models of our application.
Install from NPM.
$ npm install --save sails-hook-graysql
That's it. When you install this hook, it will scan all your models and provide a GraphQL schema from them. You can access the generated GraphQL schema in /graphql
or in the URL that you configure.
By default, configuration lives in sails.config.graysql
. The configuration key graysql
can be changed by setting sails.config.hooks['sails-hooks-graysql'].configKey
.
Parameter | Type | Details |
---|---|---|
url | ((string)) | The url in which sails will server the GraphQL schema. Defaults to /graphql . |
graphiql | ((boolean)) | Whether or not sails should use graphiql. |
ignored | ((list)) | A list of names of models to ignore. |