mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
feat: move content to shopify
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -562,13 +562,19 @@ export async function getMetaobjectsByIds(ids: string[]) {
|
||||
return reshapeMetaobjects(res.body.data.nodes);
|
||||
}
|
||||
|
||||
export async function getMetaobjectById(id: string) {
|
||||
export async function getMetaobject({
|
||||
id,
|
||||
handle
|
||||
}: {
|
||||
id?: string;
|
||||
handle?: { handle: string; type: string };
|
||||
}) {
|
||||
const res = await shopifyFetch<{
|
||||
data: { metaobject: ShopifyMetaobject };
|
||||
variables: { id: string };
|
||||
variables: { id?: string; handle?: { handle: string; type: string } };
|
||||
}>({
|
||||
query: getMetaobjectQuery,
|
||||
variables: { id }
|
||||
variables: { id, handle }
|
||||
});
|
||||
|
||||
return res.body.data.metaobject ? reshapeMetaobjects([res.body.data.metaobject])[0] : null;
|
||||
|
@@ -20,8 +20,8 @@ export const getMetaobjectsQuery = /* GraphQL */ `
|
||||
`;
|
||||
|
||||
export const getMetaobjectQuery = /* GraphQL */ `
|
||||
query getMetaobject($id: ID!) {
|
||||
metaobject(id: $id) {
|
||||
query getMetaobject($id: ID, $handle: MetaobjectHandleInput) {
|
||||
metaobject(id: $id, handle: $handle) {
|
||||
id
|
||||
type
|
||||
fields {
|
||||
|
@@ -4,6 +4,8 @@ export const colors = {
|
||||
secondary: '#EF6C02',
|
||||
blue: {
|
||||
800: '#1C1F35',
|
||||
200: '#666C89'
|
||||
200: '#666C89',
|
||||
500: '#2D3A7B',
|
||||
600: '#111C55'
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user