-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataloaders for existing REST APIs as data source #1433
Comments
If you're referring to a mapper from existing APIs to graphene types similar to the |
@erikwrede : https://graphql.org/blog/rest-api-graphql-wrapper/ I tried to replicate it in Django graphene(Python implementation) and was successful in making requests in schema query and mapping it to graphene.ObjectType like this. Like in the graphql Javascript demo would like to add data loaders. |
This works very similar to the JS tutorial. As mentioned above, you will need to use aiodataloader. Now you need to create your graphene object types with the correctly typed fields. Then create data loaders for all the object types. These should return an instance of the object type based on the object id. Inside of the dataloaders you can use httpx, requests or other HTTP clients to make your rest calls. |
Is there a feature already existing for dataLoaders to load graphene RESTFUL APIs as datasource
current Behaviour
https://docs.graphene-python.org/en/latest/execution/dataloader/#using-with-graphene
Existing docs provide info to load the data from database and load dataloaders by filtering id.
Please suggest if there a way to use dataloaders for existing REST APIs as data source.
Couldn't find it anywhere in docs
https://stackoverflow.com/questions/48541204/graphene-relation-using-restfull-api-as-data-source
https://stackoverflow.com/questions/72544729/graphql-wrapper-for-rest-apis-with-django?noredirect=1&lq=1
The text was updated successfully, but these errors were encountered: