Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
27d8f4c
chore: bump graphql major version
vladar Jan 19, 2021
6fe2604
fix graphql-compose deprecations
vladar Jan 19, 2021
989b8c5
graphql-compose: fix args mapping for directives
vladar Jan 19, 2021
b9f0e73
graphql-compose: fix incorrect type merging
vladar Jan 19, 2021
faf26b2
graphql-compose: fix merged type assignment
vladar Jan 19, 2021
115215b
graphql-compose: change approach to temp types
vladar Jan 21, 2021
1280985
graphql-compose: remove unneded thunk
vladar Jan 21, 2021
fc12089
graphql: update error messages in test assertions
vladar Jan 21, 2021
bcac68b
graphql-compose: use main composer for temporary types
vladar Jan 21, 2021
126b7ec
graphql-compose: use new API toInputObjectType vs getInputTypeComposer
vladar Jan 21, 2021
3b364ab
graphql-compose: use graphql-js fields when building fields enum
vladar Jan 21, 2021
40004ee
graphql-compose: skip redundant wrapping of resolvers
vladar Jan 21, 2021
7832a67
updated printer snapshots (ordering of printed types have changed)
vladar Jan 21, 2021
2ce7551
graphql-compose: use the new API in place of the old getWrapped()
vladar Jan 21, 2021
395e460
graphql-compose: use schemaComposer.merge for third-party-schema merging
vladar Jan 22, 2021
e1b1234
graphql-compose: fix for new behavior when returning interfaces from …
vladar Jan 22, 2021
ce248ab
graphql-compose: another snapshot update
vladar Jan 22, 2021
9c9c462
fix inline snapshot incorrectly changed in commit fc12089feab23f8be5d…
vladar Jan 22, 2021
459cd9c
graphql: no more smart wrapping and indenting in printed description
vladar Jan 22, 2021
cbb8be9
graphql-compose: api change in typeComposer.getField()
vladar Jan 22, 2021
b206f6b
graphql-compose: always expect astNode
vladar Jan 22, 2021
73eacb3
graphql-compose: follow up to commit cbb8be91edfb25da26a018f632ead63c…
vladar Jan 22, 2021
b2ed79d
graphql-compose: fix rebuild with site page
vladar Jan 22, 2021
63bb191
Revert "graphql-compose: use schemaComposer.merge for third-party-sch…
vladar Jan 22, 2021
15ad384
graphql-compose: fix another "schema must contain unique types" error
vladar Jan 25, 2021
d502b78
slight optimization
vladar Jan 25, 2021
1228583
update rebuild-schema snapshot
vladar Jan 25, 2021
d5bb827
update build-schema snapshot
vladar Jan 25, 2021
47e543a
update printer snapshot
vladar Jan 25, 2021
86e521b
fix test
vladar Jan 25, 2021
7b37f75
fix filters.removeEmptyFields
vladar Jan 25, 2021
17d9ee8
update gatsby-source-graphql snapshot
vladar Jan 25, 2021
247f081
fix test gatsby-codemods
vladar Jan 25, 2021
0034ab7
fix typescript
vladar Jan 25, 2021
8c02053
Merge branch 'master' into v3/bump-graphql
vladar Jan 25, 2021
a7e6054
temporarily disable weirdly failing test
vladar Jan 25, 2021
70c8958
fix snapshot
vladar Jan 26, 2021
11f6d01
gatsby-transformer-sharp: fix incorrect enum value
vladar Jan 26, 2021
557df4f
gatsby-plugin-image: fix incorrect enum value
vladar Jan 26, 2021
43b7052
use thunks for fields
vladar Jan 27, 2021
ba2681a
graphql-compose: fix early type access
vladar Jan 28, 2021
5f91b72
Merge branch 'master' into v3/bump-graphql
vladar Jan 29, 2021
12ee06c
use graphql-compose version with a recent perf fix
vladar Jan 29, 2021
4fc6ce0
graphql-compose: fix invalid warnings
vladar Feb 2, 2021
cd69543
re-enable skipped test with new assumptions
vladar Feb 5, 2021
23145ef
fixing minor things
vladar Feb 5, 2021
3b55392
Merge branch 'master' into v3/bump-graphql
vladar Feb 5, 2021
4da480a
improve test assertion
vladar Feb 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading