1 Answers
A:
To consume a REST API through KeystoneJS, you can create custom resolvers or hooks within your schema. This is a simple method that makes use of custom GraphQL resolvers:
axios
or node-fetch
within the resolver to make API calls to the REST endpoint.Example:
This query will fetch data from the external API and expose it through your Keystone GraphQL schema.
KeystoneJS
Keystone JanitorialDisclaimer
Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.
20,000+ Software Listed
Best
Price Guaranteed
Free Expert
Consultation
2M+
Happy Customers