com.dft.api.shopify.GraphqlAPI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shopify-admin-rest Show documentation
Show all versions of shopify-admin-rest Show documentation
Shopify Admin REST API using JDK 11 and Reactive Programming
The newest version!
package com.dft.api.shopify;
import com.dft.api.shopify.model.auth.AccessCredential;
import com.dft.api.shopify.v202401.model.graphqlapi.GraphQlQuery;
import com.dft.api.shopify.v202401.model.graphqlapi.appsubscription.AppSubscriptionResponse;
import com.dft.api.shopify.v202401.model.graphqlapi.graphqlresponse.GraphQlQueryResponse;
import java.net.URI;
import java.net.http.HttpRequest;
public class GraphqlAPI extends ShopifySdkNew {
private static final String VERSION_2024_01 = "/2024-01";
private static final String ENDPOINT = "/graphql";
public GraphqlAPI(AccessCredential accessCredential) {
super(accessCredential);
}
public GraphQlQueryResponse metaFieldDefinitionGraphQl(GraphQlQuery graphQlQuery) {
URI uri = baseUrl(VERSION_2024_01, ENDPOINT);
HttpRequest request = postWithObject(uri, graphQlQuery);
return getRequestWrapped(request, GraphQlQueryResponse.class);
}
public AppSubscriptionResponse appSubscriptionGraphQl(GraphQlQuery graphQlQuery) {
URI uri = baseUrl(VERSION_2024_01, ENDPOINT);
HttpRequest request = postWithObject(uri, graphQlQuery);
return getRequestWrapped(request, AppSubscriptionResponse.class);
}
}