-
-
Save seit/050f2b0624e4849cddad85a74e78085e to your computer and use it in GitHub Desktop.
GraphqlController_1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String graphqlExec(){ | |
QueryJson query = new QueryJson( | |
query("<商品ID>", | |
"<コレクションID>")); | |
String resJsonStr = apiClient.post(query,String.class); | |
logger.debug(resJsonStr); | |
return "index"; | |
} | |
private String query(String productId, String CollectionId){ | |
// 商品がコレクションに含まれているか確認 | |
return "query {" | |
+ " product(id:\"" + productId + "\") {" | |
+ " storefrontId" | |
+ " inCollection(id:\""+ CollectionId + "\") " | |
+ " variants(first:250){" | |
+ " edges{" | |
+ " node{" | |
+ " storefrontId" | |
+ " }" | |
+ " }" | |
+ " }" | |
+ " }" | |
+ "}"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment