@formidablejs/graphql
v0.0.1
Published
GraphQL support for the Formidable Framework.
Downloads
1
Readme
GraphQL Plugin
GraphQL support for the Formidable Framework.
Requirements
- @formidablejs/framework:
>=0.12.1
Install
npm:
npm i @formidablejs/graphql
yarn:
yarn add @formidablejs/graphql
Publish
node craftsman package:publish --package="@formidablejs/graphql" --tag="config,schema-resolvers"
Config
Add GraphQLServiceResolver
in the config/app.imba
or config/app.ts
config under resolvers
:
...
import { GraphQLServiceResolver } from '@formidablejs/graphql'
...
export default {
...
resolvers: {
...
GraphQLServiceResolver
Then, register the graphql.imba
config file in the config/index.imba
or config/index.ts
file.
config/index.ts
import graphql from './graphql';
export class Config extends ConfigRepository
{
/**
* All of the configuration items.
*
* @type {Object}
*/
get registered() : Object
{
return {
...
graphql
config/index.imba
import graphql from './graphql'
export class Config < ConfigRepository
{
# All of the configuration items.
#
# @type {Object}
get registered
{
...
graphql
And finally test your GraphQL API:
# serve application
node craftsman serve --dev --port=3000
# test graphql
curl -H "Content-Type:application/graphql" -XPOST -d "query { add(x: 2, y: 2) }" http://localhost:3000/graphql
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.