I’m attempting to query for an AppSubscription but I keep getting the error GraphQL::Client::ValidationError: uninitialized constant on and I’m not sure why. There are multiple docs (here and here) that indicate that it should work but I keep getting that error.
This is how I’m using the query with the Ruby shopify_api gem:
def query
@query ||= client.parse <<~GRAPHQL
{
node(id: "gid://shopify/AppSubscription/24811667616") {
id
AppSubscription {
billingInterval
createdAt
currentPeriodEnd
id
name
status
test
}
}
}
GRAPHQL
end
If I take out the client.parse part I as per the example in the node documentation I get the following error: TypeError: expected definition to be a GraphQL::Client::OperationDefinition but was GraphQL::Language::Nodes::Document
I’ve even tried the curl request but I get a Bad Request error.
Any help would be appreciated.