Skip to content
Discussion options

You must be logged in to vote

@vladar This works:

exports.createResolvers = ({ createResolvers }) => {
  createResolvers({
    DatoCmsMattress: {
      shopifyInfo: {
        type: [`ShopifyProduct`],
        resolve(source, args, context, info) {
          const fieldValue =
            source.entityPayload.attributes.shop_matt_connection;
          return context.nodeModel.runQuery({
            query: { filter: { shopifyId: { eq: fieldValue } } },
            type: `ShopifyProduct`,
            // Not sure why removing this made it work?!?
            // firstOnly: true,
          });
        },
      },
    },
  });
};

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@wildpow
Comment options

@wildpow
Comment options

@vladar
Comment options

@wildpow
Comment options

@wildpow
Comment options

Comment options

You must be logged in to vote
2 replies
@vladar
Comment options

@wildpow
Comment options

Comment options

You must be logged in to vote
1 reply
@vladar
Comment options

Answer selected by LekoArts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants