Our application consists of a backend service developed with the React template and an events-consumer for our Kafka events. Both of them interacts with Shopify GraphQL Admin API.
The backend application uses AdminGraphqlApi client, which is initialized like in the example, using authenticate in the request handler, and then using admin.graphql to do the requests to the API.
The events-consumer uses AdminApiClientcreated with createAdminApiClient from @shopify/admin-api-client.
The app and the events-consumer use a lot of similar GraphQL queries and we want to extract the common code. AFAIU, the AdminGraphqlApi and AdminApiClient have different interfaces, so we might need to create an extra adapter layer around them.
Have you ever done something like this? Is there documentation on the clients’ interfaces? Or maybe I can have a look at their source code?
I am fairly new to Javascript and Typescipt, so it’s a little difficult to find my way around different builds and packages, so any help would be greatly appreciated.