feat: add shared GraphQL note queries module

This commit is contained in:
anshk 2026-03-13 19:54:09 +05:30
parent 67134d4a7c
commit 8b2189a6ca

View File

@ -0,0 +1,69 @@
export const CREATE_NOTE = `#graphql
mutation CreateNote($ownerId: ID!, $value: String!) {
metafieldsSet(
metafields: [{
ownerId: $ownerId,
namespace: "custom",
key: "note",
type: "single_line_text_field",
value: $value
}]
) {
metafields {
id
key
value
}
}
}
`;
export const UPDATE_NOTE = `#graphql
mutation UpdateNote($ownerId: ID!, $value: String!) {
metafieldsSet(
metafields: [{
ownerId: $ownerId,
namespace: "custom",
key: "note",
type: "single_line_text_field",
value: $value
}]
) {
metafields {
id
value
}
}
}
`;
export const DELETE_NOTE = `#graphql
mutation DeleteNote($id: ID!) {
metafieldsDelete(metafields: [{ id: $id }]) {
deletedMetafields {
id
}
userErrors {
field
message
}
}
}
`;
export const READ_NOTES = `#graphql
query ReadNotes {
products(first: 20) {
edges {
node {
id
title
metafield(namespace: "custom", key: "note") {
id
value
}
}
}
}
}
`;