Skip to content

Commit

Permalink
use actions
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Mar 1, 2022
1 parent b338fc5 commit 3aa8f61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const {
polyfillImageServiceDevRoutes,
} = require(`gatsby-plugin-utils/pollyfill-remote-file`)

exports.createSchemaCustomization ({ actions, schema, store }) => {
exports.createSchemaCustomization ({ actions, schema }) => {
actions.createTypes([
addRemoteFilePolyfillInterface(
schema.buildObjectType({
Expand All @@ -107,7 +107,7 @@ exports.createSchemaCustomization ({ actions, schema, store }) => {
}),
{
schema,
store,
actions,
}
)
]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import path from "path"
import type { Store } from "gatsby"
import type { Actions } from "gatsby"
import { publicUrlResolver } from "../index"
import * as dispatchers from "../jobs/dispatchers"

jest.spyOn(dispatchers, `shouldDispatch`).mockImplementation(() => false)

describe(`publicResolver`, () => {
const store = {} as Store
const actions = {} as Actions

it(`should return a file based url`, () => {
const source = {
Expand All @@ -23,7 +23,7 @@ describe(`publicResolver`, () => {
},
}

expect(publicUrlResolver(source, store)).toEqual(
expect(publicUrlResolver(source, actions)).toEqual(
`/_gatsby/file/${Buffer.from(source.url).toString(`base64`)}/file.pdf`
)
})
Expand All @@ -43,7 +43,7 @@ describe(`publicResolver`, () => {
},
}

expect(publicUrlResolver(source, store)).toEqual(
expect(publicUrlResolver(source, actions)).toEqual(
`/_gatsby/file/${Buffer.from(source.url).toString(`base64`)}/image.jpg`
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
gatsbyImageResolver,
} from "./graphql/gatsby-image-resolver"

import type { Store, Actions } from "gatsby"
import type { Actions } from "gatsby"
import type { InterfaceTypeComposerAsObjectDefinition } from "graphql-compose"
import type { SchemaBuilder, IRemoteFileNode } from "./types"

Expand Down Expand Up @@ -45,11 +45,9 @@ function addRemoteFilePolyfillInterface<
type: T,
{
schema,
store,
actions,
}: {
schema: SchemaBuilder
store: Store
actions: Actions
}
): T {
Expand Down

0 comments on commit 3aa8f61

Please sign in to comment.