GithubHelp home page GithubHelp logo

uroslates / wundergraph-operations-autogeneration Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 476 KB

Draft implementation for Wundergraph's requested **Autogenerate Introspected Apis Operations [#855](https://github.com/wundergraph/wundergraph/issues/855)** Feature.

Home Page: https://github.com/wundergraph/wundergraph/issues/855

License: Apache License 2.0

TypeScript 63.64% JavaScript 36.36%
wundergraph

wundergraph-operations-autogeneration's Introduction

WunderGraph Custom Operations Auto-Generation

This repository is created to showcase how we could extend/enhance Wundergraph to introduce a new feature of autogenerating introspected datasources operations (as graphql operations).

For more detailed information about this feature you could have a look at the respective issue (feature request issue) on Wundegraph's Gihtub Repo.

Getting started

npm i && npm start

Custom Operation Autogeneration

To generate custom operations (from specific wundergraph apiNamespace) you can run npm run autogenerate:wg:gql:operations.

This will result in generating custom wundegraph operations within .wundergraph/operations/{apiNamespace} folder that you can start using within your graphql or js/ts wundergraph operations for futher composition.

Auto-Generate graphql operations from OCC Spec

For autogenerating occ apiNamespace graphqul operations, run the following:

npm run autogenerate:wg:gql:operations -- occ

Test the operation by calling the generated operations REST endpoints:

You could now also consume custom auto-generated occ operations within the ts based operations (look at the .wundergraph/operations/users/get.ts).

Auto-Generate graphql operations from countries apiNamespace

For autogenerating countries apiNamespace graphqul operations, run the following:

npm run autogenerate:wg:gql:operations -- countries

Get all Continents

curl http://localhost:9991/operations/Continents

Get all Countries

curl http://localhost:9991/operations/Countries

Get user

curl http://localhost:9991/operations/users/get?id=1

Learn More

Read the Docs.

Deploy to WunderGraph Cloud

Deploy to WunderGraph

Need Help?

Got any questions or need any development related work feel free to contact me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.