Shows an example of a GraphQL Server using dataloader-codegen. Prints data from https://swapi.dev.
Clone dataloader-codegen and build locally:
$ git clone git@github.com:Yelp/dataloader-codegen.git
$ cd dataloader-codegen
$ make build
$ yarn linkBuild the example:
$ cd examples/swapi
$ yarn
$ yarn link dataloader-codegen
$ make swapi-loaders.ts
$ make build
# Prints out a GraphQL query result:
$ node build/swapi-server.jsswapi-loaders.js: An autogenerated file by dataloader-codegen. Contains the codegen'd dataloaders. (Checked in to git so folks can easily see an example of the generated code).swapi.js: A set of functions to fetch data from https://swapi.dev/. This is analogous to a library generated by openapi-generator/swagger-codegen.swapi-server.js: The dummy GraphQL server! This imports the dataloaders from swapi-loaders.js. At present, it just prints the result of a query to stdout.