shopify-api-js
shopify-api-js copied to clipboard
response is not defined
Hello, Why I get this error:
const test_session = await Shopify.Utils.loadCurrentSession(request, response);
^
ReferenceError: response is not defined
Code:
const {Shopify, ApiVersion} = require('@shopify/shopify-api');
const { Product } = require('@shopify/shopify-api/dist/rest-resources/2022-04/index.js');
Shopify.Context.initialize({
API_KEY: 'xxx',
API_SECRET_KEY: 'xxx',
SCOPES: ['read_products'],
HOST_NAME: 'https://storemany.myshopify.com/'.replace(/https:\/\//, ""),
API_VERSION: ApiVersion.April22,
IS_EMBEDDED_APP: true,
});
const test_session = await Shopify.Utils.loadCurrentSession(request, response);
const d = await Product.all({
session: test_session
})
@shop-fluencer have you fixed this issue have the same issue?
With what framework is the app being used? E.g., express, koa, etc.? The request/response should be coming from the framework or from Node.
@mkevinosullivan thanks lot for your concern into my query
Expresss js with graphql
i build the shopify app node react base on shopify boiler plate
https://graphql.org/graphql-js/running-an-express-graphql-server/
`
var app = express(); app.use('/graphql', graphqlHTTP({ schema: schema, rootValue: root, graphiql: true, })); app.listen(4000);
`
I can't see any request /response
how do integrate with graphQL with express shopify auth middle ware?
This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.
@shop-fluencer we have now released a v6 of the api. May I invite you to migrate to v6 through this guide and let u know if you can still reproduce the issue ? And re open that one if you can still reproduce it ?