@godspeedsystems/plugins-graphql-as-eventsource v1.2.3
godspeed-plugin-graphql-as-eventsource
Welcome to the Godspeed GraphQL Plugin! π
Godspeed leverages Apollo Server, a powerful and extensible open-source server built on GraphQL, to streamline the creation of GraphQL APIs. Apollo Server excels in automatic schema generation and seamless integration with diverse data sources, providing a robust foundation for scalable and high-performance GraphQL applications.
This guide offers a concise overview of integrating the GraphQL plugin into the Godspeed framework as an Event Source.
Steps to Utilize the GraphQL Plugin in the Godspeed Framework:
Example Usage:
Add the GraphQL plugin to Godspeed-CLI with the
godspeed plugin add
command.Tailor the configuration file according to your needs in
eventsource/graphql.yaml
.
How to Use
- Create a godspeed project from the CLI , open the created project in vscode and then add the plugin from the CLI of vscode, select the
@godspeedsystems/plugins-graphql-as-eventsource
to integrate the plugin.
> godspeed plugin add
,_, ββββββββββββββββββββββββββββββββββββββ
(o,o) β Welcome to Godspeed β
({___}) β World's First Meta Framework β
" " ββββββββββββββββββββββββββββββββββββββ
? Please select godspeed plugin to install: (Press <space> to select, <Up and Down> to move rows)
ββββββ¬ββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Name β Description β
ββββββΌββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β―β― β graphql-as-eventsource β graphql as eventsource plugin for Godspeed Framework β
ββββββΌββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β― β aws-as-datasource β aws as datasource plugin for Godspeed Framework β
ββββββΌββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β― β mailer-as-datasource β mailer as datasource plugin for Godspeed Framework β
ββββββΌββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β― β excel-as-datasource β excel as datasource plugin for Godspeed Framework β
ββββββΌββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β― β kafka-as-datasource-as-eventsourceβ kafka as datasource-as-eventsource plugin for Godspeed Frameworkβ
ββββββ΄ββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
GraphQL Configuration (src/eventsources/Apollo.yaml)
type: graphql
port: 4000
- Ensure the event key prefix aligns with the name of the configuration YAML file. In this example, the prefix for the Event key is
Apollo
. The event schema follows REST standards, resembling HTTP events.
GraphQL Event (src/events/create_category.yaml)
graphql.post./mongo/category:
summary: Create a new Category
description: Create Category from the database
fn: create
body:
content:
application/json:
schema:
type: object
properties:
name:
type: string
responses:
content:
application/json:
schema:
type: object
GraphQL Workflow (src/functions/create.yaml)
summary: Create Category
tasks:
- id: mongo_category_create
fn: datasource.mongo.Category.create
args:
data: <% inputs.body %>
use
godspeed gen-graphql-schema
to auto generate graphql schema.use
godspeed serve
to start server.
This configuration emphasizes the simplicity of implementing GraphQL within the Godspeed framework, promoting efficiency and clarity in API development.
Happy coding with Godspeed...π