All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dft.api.shopify.GraphqlAPI Maven / Gradle / Ivy

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy