【发布时间】:2022-01-15 21:12:18
【问题描述】:
我正在尝试借助此代码和library 读取我在shopify 后端上传的文件:
const shopify = new Shopify({
shopName: process.env.STORE_NAME,
apiKey: process.env.API_KEY,
password: process.env.STORE_PASSWORD,
});
const query = `{
files {
edges {
node {
alt
}
}
}
}`;
shopify
.graphql(query)
.then((files) => console.log(files))
.catch((err) => console.error(err));
但是我遇到了这个错误
Error: Field 'files' doesn't exist on type 'QueryRoot'
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
locations: [ { line: 2, column: 7 } ],
path: [ 'query', 'files' ],
extensions: { code: 'undefinedField', typeName: 'QueryRoot', fieldName: 'files' },
response: <ref *1> PassThrough
}
如果有人可以帮助我,我将不胜感激。 谢谢!
【问题讨论】:
标签: node.js graphql shopify shopify-api shopify-api-node