admin管理员组文章数量:1414604
export const loader = async ({ request }: LoaderFunctionArgs) => {
await authenticate.admin(request);
const admin = await authenticate.admin(request);
const email = "[email protected]";
const response = await admin.admin.graphql(
`#graphql
query GetCustomers($query: String!) {
customerByIdentifier(identifier: {emailAddress: $query}) {
id
}
}
`,
{
variables: { query: email }
}
);
const data = await response.json();
console.log(">>>>> data", data, "<<<<<<");
return json({ apiKey: process.env.SHOPIFY_API_KEY || "" });
};
enter image description here
I have a big problem. Recently it became possible via Shopify's admin API to make a customerByIdentifier request that looks like this
{
customerByIdentifier(identifier) {
# Customer fields
}
}
As you can see from the above code, I am querying via graphQl and all I get on Frontend is ‘Error: Field “customerByIdentifier” doesn't exist on type “QueryRoot”’
But when I test this query in the Shopify GraphQl App it gives me the user on this query correctly, here is the query I make through apk
{
customerByIdentifier(identifier: {emailAddress: ‘[email protected]’}) {
id
}
}
Help me understand what I'm doing wrong ?
版权声明:本文标题:javascript - Shopify Error: Field 'customerByIdentifier' doesn't exist on type 'QueryRoot 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745175551a2646219.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论