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.
npm i && npm start
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.
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).
For autogenerating countries
apiNamespace
graphqul operations, run the following:
npm run autogenerate:wg:gql:operations -- countries
curl http://localhost:9991/operations/Continents
curl http://localhost:9991/operations/Countries
curl http://localhost:9991/operations/users/get?id=1
Read the Docs.
Got any questions or need any development related work feel free to contact me.