- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Shopify - Migrate to Updated GraphQL API #15827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from 3 commits
      Commits
    
    
            Show all changes
          
          
            13 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      8230734
              
                updates to sources
              
              
                michelle0927 2f746a5
              
                actions updates
              
              
                michelle0927 970252e
              
                pnpm-lock.yaml
              
              
                michelle0927 c932b1d
              
                updates per QA
              
              
                michelle0927 1d2bd08
              
                remove console.log
              
              
                michelle0927 c0bfd44
              
                fix typo
              
              
                michelle0927 80e0527
              
                remove duplicate mutation
              
              
                michelle0927 0c6c374
              
                updates
              
              
                michelle0927 1841eeb
              
                Merge remote-tracking branch 'origin/master' into issue-15731
              
              
                michelle0927 c5e00aa
              
                pnpm-lock.yaml
              
              
                michelle0927 c0ed016
              
                pnpm-lock.yaml
              
              
                michelle0927 21027eb
              
                package.json
              
              
                michelle0927 f7f8775
              
                bulk-import version
              
              
                michelle0927 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or 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
    
  
  
    
              
        
          
          
            19 changes: 0 additions & 19 deletions
          
          19 
        
  components/shopify/actions/add-product-to-custom-collection/common.mjs
  
  
      
      
   
        
      
      
    This file was deleted.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or 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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,15 +1,72 @@ | ||
| import shopify from "../../shopify.app.mjs"; | ||
| import common from "./common.mjs"; | ||
|  | ||
| export default { | ||
| ...common, | ||
| name: "Add Tags", | ||
| version: "0.0.12", | ||
| key: "shopify-add-tags", | ||
| description: "Add tags. [See the documentation](https://shopify.dev/api/admin-graphql/2022-07/mutations/tagsadd)", | ||
| name: "Add Tags", | ||
| description: "Add tags. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/tagsAdd)", | ||
| version: "0.0.13", | ||
| type: "action", | ||
| props: { | ||
| shopify, | ||
| ...common.props, | ||
| resource: { | ||
| type: "string", | ||
| label: "Resource Type", | ||
| description: "The Shopify Admin API resource type.", | ||
| options: [ | ||
| "Product", | ||
| "Customer", | ||
| "Order", | ||
| "DraftOrder", | ||
| "Article", | ||
| ], | ||
| reloadProps: true, | ||
| }, | ||
| gid: { | ||
| type: "string", | ||
| label: "Resource ID", | ||
| description: "The Shopify Admin Resource ID. For example, the ID of a Product, Customer, Order, DraftOrder, or OnlineStoreArticle. Can be found at the end of the URL in Shopify Admin.", | ||
| }, | ||
| tags: { | ||
| propDefinition: [ | ||
| shopify, | ||
| "tags", | ||
| ], | ||
| }, | ||
| }, | ||
| async additionalProps(existingProps) { | ||
| const props = {}; | ||
| if (!this.resource) { | ||
| return props; | ||
| } | ||
| if (this.resource === "Product") { | ||
| props.gid = { | ||
| ...existingProps.gid, | ||
| options: async ({ prevContext }) => { | ||
| try { | ||
| return await this.shopify.getPropOptions({ | ||
| resourceFn: this.shopify.listProducts, | ||
| resourceKeys: [ | ||
| "products", | ||
| ], | ||
| prevContext, | ||
| }); | ||
| } catch { | ||
| console.log("Unable to fetch product options"); | ||
| } | ||
| }, | ||
| }; | ||
| } | ||
| return props; | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.shopify.addTags({ | ||
| gid: this.gid, | ||
| tags: this.tags, | ||
| }); | ||
| if (response.tagsAdd.userErrors.length > 0) { | ||
| throw new Error(response.tagsAdd.userErrors[0].message); | ||
| } | ||
| $.export("$summary", `Added tag(s) \`${this.tags}\` with id \`${response.tagsAdd.node.id}\``); | ||
| return response; | ||
| }, | ||
| }; | 
This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or 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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came here to find out why my Shopify Developer App component actions were throwing errors today.
Stack trace:
From what I can tell, this PR appears to be the issue, as this
common.mjsfile is a dependency in that component, but it was removed here.I'm guessing most of the Shopify Developer App actions have a dependency on this common file (see example here), so I think this is probably pretty urgent to resolve.