Gadget Developers

GD

Gadget Developers

Build SAAS apps alongside thousands of other Gadget developers. Get help, and offer help to others in the community.

Join

Call gadget action from an extension

Hey, I want to trigger a GraphQL mutation when a customer clicks a button inside an app block. I know I can write backend code in the global actions folder, but I need to understand how to trigger it via the Shopify extension....

Error when trying to get the result of a background task

I am trying to use background tasks to deal with rate limiting from an external API. I have this function ```js export async function discordRequest(endpoint, options) { const task = await api.enqueue( api.discordRequest,...

problem with order/create webhook

alright so my app functionality is based on when an order is created, the entire logic is in the run function of the orders/create action, however, if I add an exception to not run that code on orders/update or orders/risk_assessment_change webhook then it misses the majority of the orders so I cant exempt it from that either. So the problem usually arises with new customers when they update an order that was placed before the app was installed, it runs the same action on that order although that order is old and not actually being created but rather just updated. This is kinda confusing you can help me with it. Another problem which i have talked about previously as well is the missing data in the record object. The workaround I found for this was to just fetch order id drom the record and call the shopify api for the rest but i suspect that has really sky rocketed my request time usage, do you think that might be true?...

Adding type definition to Actions.

I have a .js project which in which i am transforming some files to .ts. I get many .ts warnings and would like to know how to add proper type definition. I tried :ActionRun but it doesnt work...
No description

Help with data models

Hello im new to this and im having a hard time fetching data from a data model and displaying it onto a theme app extension any idea where to start

Gadget websocket support ?

Does gadget support websockets ? Couldn’t find it in the docs

Using pub/sub with Gadget

I want to subscribe to the order webhook using google pubsub to handle the data since Gadget would be to expensive due to request time for me. In the Shopify docs is described to add the permission as well as the webhook to the toml file. But the existing permissions from gadget are not in that file so I need to dublicate them every time I do changes there. Is there an easier way / does the toml configuration change anything with the current Gadget Webhooks / other parts of Gadget? Thanks 🙂...

Filter and sorting based off models relationship field?

I am essentially trying to build a table that has a combination of data from orders and orderlines. My issue however is filtering and sorting on fields from the orderline and fields from the order. Using the query below, as far as I'm aware I can only filter and sort on the top level orderLineItem fields and I cannot filter or sort on order fields? I've pulled these out into two separate queries, so I could filter and sort each and map the data back together again. However then I fall into pagination issues....

Is there a way to know in gadget if a product/variant is a bundle or not?

Need to filter out certain actions based on if its a bundle or not

Oauth error missing permissions

I have added more admin api access scopes through gadget and getting oauth missing error
No description

Upsert - [GraphQL] Error: undefined argument

Hi all. I'm trying to upsert shopifyBulkOperation records, but I'm getting the error [GraphQL] Error: undefined argument. I'm not sure what I'm missing here?
No description

Cron Expression is not valid?

Hi why is the cron expression of e.g. every 2hours not working (it also show an error)? I put some logs to check if it will trigger but it didn't although the trigger is working if it is e.g. every 5 mins
No description

Gadget syncing

So I run my own daily sync, and I've just noticed when Gadget makes the GraphQL calls to Shopify, its only using a page limit of 10? Why is this so low when you can request up to 250? Surely this would increase request time as its using a smaller page limit?
No description

How do you access the webhook payload details from an action?

I've setup a webhook as a trigger for my action. I'm wondering how to access the details of the webhook payload in my action?
No description

ERR_GOT_REQUEST_ERROR: Internal error. Looks like something went wrong on our end.

Hi guys. I'm getting this error when trying to make a graphql request from a global action. Can someone help? Request ID: 57d7f2f5-f48d-415a-9022-67f26e4ef63b-1738692757...

Shopify payment authorization

I’ve been building an app for a “Buy Now, Try, and Pay Later” model. To enable this, I set the product price to 0 at checkout. I need a way to charge customers later if they decide to keep the product after the trial....

Upserting limit

When doing an upsert we pass something like on: ['shop', 'date'], so in this case its for daily records against a shop. I'm now introducing another model which will be for a location for a shop daily, so I'll need to do something like on: ['shop', 'date', 'location] Is it acceptable to do more than 2 fields in an upsert? Or is there a proper way to handle this?...

Renaming custom models/fields

If I have an app already deployed to production, installed on stores and contains data, is it possible with Gadget to rename these (in dev and deploy obviously), will it break anything? I obviously will need to update my code to read from the new model, e.g. api.name1 -> api.name2. But in terms of the already stored data, will this break? I suppose the same goes for the fields on a model, can they also be renamed and data not affected?...

Hi I just pushed the gadget update and i am gettinga cors error

Hi I just pushed the gadget update and i am gettinga cors error

Modify product prices on checkout page

Hey team, I am building an app to modify the product prices at the checkout page. I am passing a cart item property to validate and change the price of that product like a buy now pay later app. What should be the recommended approach for this? Should i checkout extension or shopify functions for this? ...