I am trying to read the files that I have uploaded in shopify backend with the help of this code and library:
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));
But I am running into this error
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
}
Please if anyone can help me I will really appreciate it. Thank you!