Calling your API 


To make API calls client-side within Gadget's hosted frontend, you can use the @gadgetinc/react hooks library, it offers a set of React hooks that simplify fetching data from your Gadget app.

For example, you can fetch a list of records from your app's GraphQL API with the useFindMany hook. Each of these hooks returns an object with the requested data, the fetching state, and an error if one was encountered, as well as a refetch function for refreshing the data if needed.


To make API calls server-side in Gadget In Gadget, you have access to an api object a specialized JavaScript client tailored for the application. This client facilitates direct API interactions, enabling data retrieval and other operations. For more information refer to the actions guide.

Gadget also allows you to interact with your application's GraphQL API through the platform's API playground. It's a great way to explore your API, test queries and mutations, and debug any issues. The Playground provides built-in type checking and schema validation, which helps enforce data consistency. It's part of the thriving GraphQL ecosystem that offers developers enhanced flexibility and a better developer experience. You can access the API Playground directly from your action.