Skip to content

Commit

Permalink
chore: bump graphql and graphql-compose major versions (#29090)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladar committed Feb 9, 2021
1 parent 182d3de commit 7e4ba2b
Show file tree
Hide file tree
Showing 27 changed files with 1,221 additions and 1,178 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@babel/plugin-syntax-typescript": "^7.12.1",
"@babel/runtime": "^7.12.5",
"execa": "^5.0.0",
"graphql": "^14.7.0",
"graphql": "^15.4.0",
"jscodeshift": "^0.11.0",
"recast": "^0.20.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { graphql } from "gatsby"
export const query = graphql`{
file(relativePath: {eq: "icon.png"}) {
childImageSharp {
gatsbyImageData(transformOptions: {duotone: {highlight: "#f00e2e", shadow: "#192550"}, rotate: 50}, layout: FULL_WIDTH)
gatsbyImageData(
transformOptions: {duotone: {highlight: "#f00e2e", shadow: "#192550"}, rotate: 50}
layout: FULL_WIDTH
)
}
}
}
`
`
18 changes: 9 additions & 9 deletions packages/gatsby-plugin-image/src/resolver-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export function getGatsbyImageFieldConfig<TSource, TContext>(
description: stripIndent`
The layout for the image.
FIXED: A static image sized, that does not resize according to the screen width
FULL_WIDTH: The image resizes to fit its container. Pass a "sizes" option if it isn't going to be the full width of the screen.
FULL_WIDTH: The image resizes to fit its container. Pass a "sizes" option if it isn't going to be the full width of the screen.
CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.
`,
},
width: {
type: GraphQLInt,
description: stripIndent`
The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.
The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.
The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities
Ignored if layout = FLUID.
`,
Expand All @@ -77,34 +77,34 @@ export function getGatsbyImageFieldConfig<TSource, TContext>(
type: ImagePlaceholderType,
defaultValue: `blurred`,
description: stripIndent`
Format of generated placeholder image, displayed while the main image loads.
Format of generated placeholder image, displayed while the main image loads.
BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
TRACED_SVG: a low-resolution traced SVG of the image.
NONE: no placeholder. Set "background" to use a fixed background color.`,
},
formats: {
type: GraphQLList(ImageFormatType),
description: stripIndent`
The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.
The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.
The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do
not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying
not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying
both PNG and JPG is not supported and will be ignored. AVIF support is currently experimental.
`,
defaultValue: [`auto`, `webp`],
defaultValue: [``, `webp`],
},
outputPixelDensities: {
type: GraphQLList(GraphQLFloat),
description: stripIndent`
A list of image pixel densities to generate. It will never generate images larger than the source, and will always include a 1x image.
A list of image pixel densities to generate. It will never generate images larger than the source, and will always include a 1x image.
Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide
`,
},
sizes: {
type: GraphQLString,
defaultValue: ``,
description: stripIndent`
The "sizes" property, passed to the img tag. This describes the display size of the image.
The "sizes" property, passed to the img tag. This describes the display size of the image.
This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image
container will be the full width of the screen. In these cases we will generate an appropriate value.
`,
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby-recipes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"gatsby-core-utils": "^2.0.0-next.0",
"gatsby-telemetry": "^2.0.0-next.0",
"glob": "^7.1.6",
"graphql": "^14.6.0",
"graphql-compose": "^6.3.8",
"graphql": "^15.4.0",
"graphql-compose": "^7.24.4",
"graphql-subscriptions": "^1.1.0",
"graphql-type-json": "^0.3.2",
"hicat": "^0.8.0",
Expand Down Expand Up @@ -116,7 +116,7 @@
"@mdx-js/mdx": "^2.0.0-next.4",
"@mdx-js/react": "^2.0.0-next.4",
"@mdx-js/runtime": "^2.0.0-next.4",
"graphql": "^14.6.0",
"graphql": "^15.4.0",
"property-information": "5.5.0",
"remark-mdx": "^2.0.0-next.4",
"remark-mdxjs": "^2.0.0-next.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`NamespaceUnderFieldTransform works 1`] = `
"type Mutation {
mutation: String
"type Query {
wrapper: Wrapper!
}
type Query {
wrapper: Wrapper!
type Mutation {
mutation: String
}
type Wrapper {
Expand Down
28 changes: 14 additions & 14 deletions packages/gatsby-transformer-sharp/src/customize-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,37 +403,37 @@ const imageNodeType = ({
description: stripIndent`
The layout for the image.
FIXED: A static image sized, that does not resize according to the screen width
FULL_WIDTH: The image resizes to fit its container. Pass a "sizes" option if it isn't going to be the full width of the screen.
FULL_WIDTH: The image resizes to fit its container. Pass a "sizes" option if it isn't going to be the full width of the screen.
CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.
`,
},
width: {
type: GraphQLInt,
description: stripIndent`
The display width of the generated image for layout = FIXED, and the maximum display width of the largest image for layout = CONSTRAINED.
The display width of the generated image for layout = FIXED, and the maximum display width of the largest image for layout = CONSTRAINED.
Ignored if layout = FLUID.
`,
},
height: {
type: GraphQLInt,
description: stripIndent`
The display height of the generated image for layout = FIXED, and the maximum display height of the largest image for layout = CONSTRAINED.
The image will be cropped if the aspect ratio does not match the source image. If omitted, it is calculated from the supplied width,
The display height of the generated image for layout = FIXED, and the maximum display height of the largest image for layout = CONSTRAINED.
The image will be cropped if the aspect ratio does not match the source image. If omitted, it is calculated from the supplied width,
matching the aspect ratio of the source image.`,
},
aspectRatio: {
type: GraphQLFloat,
description: stripIndent`
If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.
If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.
If neither width or height is provided, height will be set based on the intrinsic width of the source image.
`,
},
placeholder: {
type: ImagePlaceholderType,
description: stripIndent`
Format of generated placeholder image, displayed while the main image loads.
Format of generated placeholder image, displayed while the main image loads.
BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
TRACED_SVG: a low-resolution traced SVG of the image.
NONE: no placeholder. Set "background" to use a fixed background color.`,
},
Expand All @@ -448,18 +448,18 @@ const imageNodeType = ({
formats: {
type: GraphQLList(ImageFormatType),
description: stripIndent`
The image formats to generate. Valid values are "AUTO" (meaning the same format as the source image), "JPG", "PNG", "WEBP" and "AVIF".
The image formats to generate. Valid values are "AUTO" (meaning the same format as the source image), "JPG", "PNG", "WEBP" and "AVIF".
The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do
not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying
not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying
both PNG and JPG is not supported and will be ignored.
`,
defaultValue: [`auto`, `webp`],
defaultValue: [``, `webp`],
},
outputPixelDensities: {
type: GraphQLList(GraphQLFloat),
description: stripIndent`
A list of image pixel densities to generate. It will never generate images larger than the source, and will always include a 1x image.
Default is [ 1, 2 ] for FIXED images, meaning 1x and 2x and [0.25, 0.5, 1, 2] for CONSTRAINED. In this case, an image with a constrained layout
A list of image pixel densities to generate. It will never generate images larger than the source, and will always include a 1x image.
Default is [ 1, 2 ] for FIXED images, meaning 1x and 2x and [0.25, 0.5, 1, 2] for CONSTRAINED. In this case, an image with a constrained layout
and width = 400 would generate images at 100, 200, 400 and 800px wide. Ignored for FULL_WIDTH images, which use breakpoints instead`,
},
breakpoints: {
Expand All @@ -473,8 +473,8 @@ const imageNodeType = ({
sizes: {
type: GraphQLString,
description: stripIndent`
The "sizes" property, passed to the img tag. This describes the display size of the image.
This does not affect the generated images, but is used by the browser to decide which images to download.
The "sizes" property, passed to the img tag. This describes the display size of the image.
This does not affect the generated images, but is used by the browser to decide which images to download.
You should usually leave this blank, and a suitable value will be calculated. The exception is if a FULL_WIDTH image
does not actually span the full width of the screen, in which case you should pass the correct size here.
`,
Expand Down
12 changes: 6 additions & 6 deletions packages/gatsby/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { WindowLocation, NavigateFn, NavigateOptions } from "@reach/router"
import { Reporter } from "gatsby-cli/lib/reporter/reporter"
export { Reporter }
import {
ComposeEnumTypeConfig,
ComposeInputObjectTypeConfig,
ComposeInterfaceTypeConfig,
ComposeObjectTypeConfig,
ComposeScalarTypeConfig,
ComposeUnionTypeConfig,
EnumTypeComposerAsObjectDefinition as ComposeEnumTypeConfig,
InputTypeComposerAsObjectDefinition as ComposeInputObjectTypeConfig,
InterfaceTypeComposerAsObjectDefinition as ComposeInterfaceTypeConfig,
ObjectTypeComposerAsObjectDefinition as ComposeObjectTypeConfig,
ScalarTypeComposerAsObjectDefinition as ComposeScalarTypeConfig,
UnionTypeComposerAsObjectDefinition as ComposeUnionTypeConfig,
} from "graphql-compose"
import { GraphQLOutputType } from "graphql"
import { PluginOptionsSchemaJoi, ObjectSchema } from "gatsby-plugin-utils"
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
"gatsby-telemetry": "^2.0.0-next.0",
"glob": "^7.1.6",
"got": "8.3.2",
"graphql": "^14.6.0",
"graphql-compose": "^6.3.8",
"graphql": "^15.4.0",
"graphql-compose": "^7.24.4",
"graphql-playground-middleware-express": "^1.7.18",
"hasha": "^5.2.0",
"http-proxy": "^1.18.1",
Expand Down Expand Up @@ -235,7 +235,7 @@
"url": "git+https://github.com/gatsbyjs/gatsby.git"
},
"resolutions": {
"graphql": "^14.6.0",
"graphql": "^15.0.0",
"@mdx-js/mdx": "^2.0.0-next.3",
"@mdx-js/react": "^2.0.0-next.3",
"@mdx-js/runtime": "^2.0.0-next.3",
Expand Down
5 changes: 2 additions & 3 deletions packages/gatsby/src/bootstrap/create-graphql-runner.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import stackTrace from "stack-trace"
import { Span } from "opentracing"
import { ExecutionResultDataDefault } from "graphql/execution/execute"
import { ExecutionResult, Source } from "graphql"
import { Store } from "redux"

import { GraphQLRunner } from "../query/graphql-runner"
import errorParser from "../query/error-parser"
import { emitter } from "../redux"
import { Reporter } from "../.."
import { ExecutionResult, Source } from "../../graphql"
import { IGatsbyState } from "../redux/types"
import { IMatch } from "../types"

export type Runner = (
query: string | Source,
context: Record<string, any>
) => Promise<ExecutionResult<ExecutionResultDataDefault>>
) => Promise<ExecutionResult>

export const createGraphQLRunner = (
store: Store<IGatsbyState>,
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/query/__tests__/query-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ describe(`actual compiling`, () => {
`
Object {
"context": Object {
"sourceMessage": "Cannot spread fragment \\"Foo\\" within itself via Bar.
"sourceMessage": "Cannot spread fragment \\"Foo\\" within itself via \\"Bar\\".
GraphQL request:17:13
16 | children {
Expand All @@ -452,7 +452,7 @@ describe(`actual compiling`, () => {
| ^
12 | }",
},
"error": [GraphQLError: Cannot spread fragment "Foo" within itself via Bar.],
"error": [GraphQLError: Cannot spread fragment "Foo" within itself via "Bar".],
"filePath": "mockFile",
"id": "85901",
"location": Any<Object>,
Expand Down

0 comments on commit 7e4ba2b

Please sign in to comment.