How to use GraphQL schema for public apps?

Solved
JoesIdeas
Shopify Expert
1188 104 285

I'm following the instructions here: https://github.com/Shopify/shopify_api/blob/master/docs/graphql.md

 

To make GraphQL calls with ShopifyAPI rails gem.

 

It says it automatically loads the schema dump:

Screen Shot 2020-05-10 at 8.53.05 AM.jpg 

 

But it didn't actually automatically load the schema dump for me.

 

So I looked into manually doing it, and it says run this rake task:
Screen Shot 2020-05-10 at 8.56.47 AM.jpg 

But the domain and access token is different for each user of public apps.

 

Does this mean you need to run the rake task in controller and generate a new schema file on every app install?

Or is there a way to inject shop name and token as a variable from the database when making the client request?

 

I'm looking for the best way to use GraphQL with the shopify_app gem.

 

Thanks

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfill orders + email notifications).
Creator of Theme Scientist (A/B testing app) and Tip Jar (add a tip button to your store).
0 Likes
SBD_
Shopify Staff
Shopify Staff
1043 141 183

This is an accepted solution.

Hey @JoesIdeas 

 

Did you make any progress on this?

 

It appears the dump is to "ensure your queries are valid in development", so you'll only need to generate it once - perhaps with test store credentials?

0 Likes
JoesIdeas
Shopify Expert
1188 104 285

@SBD_  Thanks, your answer got me where I needed to go. I appreciate it.

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfill orders + email notifications).
Creator of Theme Scientist (A/B testing app) and Tip Jar (add a tip button to your store).