I'm dealing with a bit of a weird use case. I am using KeyStoneJS v6, through which I must interact with a REST API, make "GET" and "POST" requests, and return the data obtained to my NextJS client through my graphql api. I have found some examples but they use old versions of KeyStone and I can't figure out how to integrate it into my current project. I can't find references in the official documentation or on the internet, so I would appreciate any hints on how to proceed. Greetings in advance.
consume a REST API through KeyStoneJS v6
356 Views Asked by Ronier Ramos Sanchez At
1
There are 1 best solutions below
Related Questions in GRAPHQL
- Expo Go crashing with on error message using Amplify Graphql to get an item
- Error: Response not successful: Received status code 405
- uninitialized constant GraphqlDevise::SchemaPlugin from graphql_devise
- Endpoint graphiql not working in Spring Boot application
- Relationships query in Tableau Metadata API by using GraphQL
- Dealing with Null Values in GraphQL API Response
- GraphQL filter query in react app with https://countries.trevorblades.com/ api
- Issue querying related data in Apollo Server 4 with Prisma Schema
- Error creating bean with name 'routerFunctionMapping' defined in class path resource
- Using Apollo client wrapper in Next.js 14 App router
- 400 Bad Request From React Axios Graphql SageX3
- graphql-java extension type redefine error from version 15
- How do I use and access the operation name in a graphQL query using spring-boot-starter-graphql and GraphQlTester?
- Upload file in GraphQL and apollo-server
- GraphQL and springboot resolver mapping problem
Related Questions in KEYSTONE
- Build of Keystone in Turborepo failed with error
- How to fetch and pass the dynamic data into the custom field (Keystone.js 6)?
- Keystone: How to get context type based on defined lists?
- how can I use a keystonejs v6 inside a nestjs app?
- How to authenticate a user in Openstack keystone who is getting authenticated in application by Azure AD
- consume a REST API through KeyStoneJS v6
- Good way/place to authenticate Keystone/Openstack API from Django
- Content versioning in Keystone 6
- Keystone 6 js: checkbox null values
- Keystone js 6: How to add access control on id field of a list
- Next run dev compiled successfully, but localhost is not loading
- Openstack python api: How create a connection using Application Credentials?
- How to resolve "Unable to resolve host" in OpenStack Yoga?
- Keystone keystone.ts: Couldn't find a Program
- Can't validate keystone endpoint when I trying to define an OpenStack cloud for juju
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
That doesn't sound like a weird use case; you need to extend your GraphQL schema with some custom queries or mutations to wrap another API. Doing so lets you build out parts of your GraphQL schema independently of your Keystone lists. You'll need to define the GraphQL types for the output data and, if you have any arguments being passed in, the input types, then write the resolver that calls out to the other API.
Have a look at the graphQL schema extension guide. It describe how to configure Keystone's
extendGraphqlSchemaoption. The Keystone 6 repo has a number of example projects demonstrating schema extension using a variety of GraphQL tooling:graphql-tsgraphql-toolsand themergeSchemas()functionThe resolvers themselves can be async, of course. You can call out to remote APIs or use the APIs exposed by the Keystone context object to interact with your database.