Code Monkey home page Code Monkey logo

Comments (4)

emcfarlane avatar emcfarlane commented on July 29, 2024 1

https://github.com/Shopify/shopify-api-js/pull/324/files thanks didn't notice the breaking changes in the API!

from simple-koa-shopify-auth.

TheSecurityDev avatar TheSecurityDev commented on July 29, 2024

Firstly, if you are getting graphqlProxy from Shopify.Utils.graphqlProxy, then I don't think there's any reason to use @shopify/koa-shopify-graphql-proxy.

But I think the issue is you are not responding to the request.

You need to do something like:

router.post("/graphql", verifyRequest({ returnHeader: true }), async (ctx) => {
   try {
      const response = await Shopify.Utils.graphqlProxy(ctx.req, ctx.res);
      ctx.response.status = 200;
      ctx.response.body = response.body;
   } catch (err) {
      ctx.response.status = 500;
      ctx.response.body = "GraphQL proxy error";
   }
});

There might be a way to get the status code from the response (instead of hardcoding 200), but I'm not exactly sure how, since Typescript isn't sure if response.status exists.

from simple-koa-shopify-auth.

emcfarlane avatar emcfarlane commented on July 29, 2024

Was working before adding changing the auth library to simple-koa-shopify-auth, but might be unrelated. Thanks for looking into it I'll update here or close soon.

from simple-koa-shopify-auth.

emcfarlane avatar emcfarlane commented on July 29, 2024

https://github.com/Shopify/shopify-api-js/blob/v5/src/utils/graphql_proxy.ts#L9

from simple-koa-shopify-auth.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.