Shopify GraphQL

Answered

Comments

8 comments

  • viliandy leonardo Product Management Director
    Answer Pro
    Top Contributor

    Hi Pangaia Admin

    We have GraphQL connector that you can use to set up integration with a Shopify GraphQL endpoint. Here is the kb for setting up a connection: https://docs.celigo.com/hc/en-us/articles/4843857027227

    Here is an example of value for the base URI in the connection:

    And to test the connection, here is an example of the query:

    In the export step, you can then build the GraphQL queries - see below for example:

    query ($var: Int!) 
    {
      customers(first: $var, query:"accepts_marketing:true" {{#if export.http.paging.token}}, after: "{{export.http.paging.token}}" {{/if}}) {
      pageInfo {hasNextPage endCursor}            
      edges {               
        node {id,firstName,lastName}            
        }
      }
    }

    The above example uses the following pagination set up

    Thanks

     

    0
  • Pangaia Admin
    Engaged
    Celigo University Level 1: Skilled

    Hi,

    Thanks for the quick response.  I can connect OK to the GraphQL but when we try to preview the export we still get a syntax error even though I have copied and pasted the code above in (I think).

    Here's the syntax error:

    {
      "errors": [
        {
          "message": "Parse error on \"query\" (STRING) at [1, 2]",
          "locations": [
            {
              "line": 1,
              "column": 2
            }
          ]
        }
      ]
    }

    and here's the config:


    I have noticed a '/' at the end of the request URL - might that be causing issues?  How would I remove that?

    Thanks,
    Stewart 

    0
  • viliandy leonardo Product Management Director
    Answer Pro
    Top Contributor

    Pangaia Admin

    Your screenshot shows the preview is successful, though it returns 0 record. If you click on the parsed output tab, you'll see the records.

    Where do you see the syntax error message?

    Thanks

    0
  • Pangaia Admin
    Engaged
    Celigo University Level 1: Skilled

    Hi Viliandy, we see the syntax error here:

    There doesn't seem to be anything in the parsed output (I tried it with accepts marketing true and false in case that was the issue).

    Thanks,

    Stewart

    0
  • viliandy leonardo Product Management Director
    Answer Pro
    Top Contributor

    Pangaia Admin

    I cannot tell where the syntax issue is at. I suggest you start with a simple query then build up to a more complex query that uses variables etc, then include pagination. Here is 1 example of a simple query asking for first 10 customer records. If you can't get the simple example below to return records (assuming you have customer records), then please log a support ticket so we can help you further. Thanks

    {  customers(first: 10) {    edges {      node {        id      }    }  }}

    0
  • Pangaia Admin
    Engaged
    Celigo University Level 1: Skilled

    Hi,

    I tried this using the integrator.io instance and it worked fine. 
    However, it doesn't seem to work on the eu.integrator.io instance - so maybe the issue is to do with that?  I noticed that the UI looks different as well - the eu.integrator.io instance has a section for Request URL which integrator.io didn't seem to.  Would you be able to get someone to look into that please?

    Thanks,
    Stewart

    0
  • viliandy leonardo Product Management Director
    Answer Pro
    Top Contributor

    Pangaia Admin

    Hi Stewart, I noted that you logged a support ticket for eu.integrator.io instance question and a support has accepted your ticket. Support team will follow up with your question via the support ticket.

    Thank you

    1
  • viliandy leonardo Product Management Director
    Answer Pro
    Top Contributor

    Pangaia Admin

    Hi Steve, fyi, we just published this guide to help with building the GraphQL request on our connector. https://docs.celigo.com/hc/en-us/articles/6177684981787-Build-GraphQL-queries

    Thanks

    0

Please sign in to leave a comment.