Skip to content

Instantly share code, notes, and snippets.

@ashhitch
Created June 8, 2021 14:21
Show Gist options
  • Save ashhitch/2f005bbcb73abb4d0eb4833af32cfe38 to your computer and use it in GitHub Desktop.
Save ashhitch/2f005bbcb73abb4d0eb4833af32cfe38 to your computer and use it in GitHub Desktop.

Revisions

  1. ashhitch created this gist Jun 8, 2021.
    21 changes: 21 additions & 0 deletions gatsby-image-graphql-toolkit.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    exports.createResolvers = function({ actions,cache,createNodeId,createResolvers,store,reporter }) {
    const { createNode } = actions;

    createResolvers({
    HATCH_ContentMediaItemType: {
    imageFile: {
    type: `File`,
    resolve(source, args, context, info) {
    return createRemoteFileNode({
    url: source.filePath,
    store,
    cache,
    createNode,
    createNodeId,
    reporter,
    })
    },
    },
    },
    })
    }