Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump GraphQL to v16 #1348

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
9 changes: 9 additions & 0 deletions .changeset/loud-turtles-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'houdini': major
'scripts': minor
'houdini-adapter-node': minor
'houdini-react': minor
'houdini-svelte': minor
---

Bump GraphQL to v16
2 changes: 1 addition & 1 deletion e2e/_api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@envelop/core": "^3.0.6",
"@kitql/helpers": "^0.8.2",
"fs-extra": "^10.1.0",
"graphql": "^15.8.0",
"graphql": "^16.9.0",
"graphql-relay": "^0.10.0",
"graphql-ws": "^5.8.2",
"graphql-yoga": "^4.0.4",
Expand Down
2 changes: 1 addition & 1 deletion e2e/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.3",
"vite": "^4.1.0",
"vite": "^4.1.4",
"wrangler": "^3.7.0"
}
}
2 changes: 1 addition & 1 deletion e2e/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"svelte-check": "^2.10.3",
"tslib": "^2.5.0",
"typescript": "^4.9.3",
"vite": "^4.1.1"
"vite": "^4.1.4"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/react": "^18.2.22",
"@vitest/ui": "^1.6.0",
"eslint-plugin-unused-imports": "^2.0.0",
"graphql": "^15.8.0",
"graphql": "^16.9.0",
"lint-staged": "^12.3.4",
"prettier": "^2.8.3",
"turbo": "^1.8.8",
Expand All @@ -58,6 +58,6 @@
"*.json": "prettier -w "
},
"resolutions": {
"graphql": "15.5.0"
"graphql": "16.9.0"
}
}
2 changes: 1 addition & 1 deletion packages/_scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"esbuild-plugin-alias": "^0.2.1",
"esbuild-plugin-replace": "^1.2.0",
"glob": "^8.0.3",
"rollup": "^3.7.4",
"rollup": "^3.27.1",
"rollup-plugin-typescript2": "^0.34.0",
"typescript": "^4.9"
}
Expand Down
1 change: 1 addition & 0 deletions packages/adapter-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build:build": "pnpm build: && pnpm build"
},
"devDependencies": {
"@types/node": "^22.5.1",
"scripts": "workspace:^",
"tsup": "^7.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
"graphql-yoga": "4.0.4",
"graphql": "15.8.0",
"graphql": "^16.9.0",
"@whatwg-node/server": "^0.9.14"
},
"devDependencies": {
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^4.9.3",
"vite": "^4.1.0"
"vite": "^4.1.4"
},
"resolutions": {
"graphql": "15.8.0",
"graphql": "16.9.0",
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/create-houdini/templates/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
"graphql-yoga": "4.0.4",
"graphql": "15.8.0",
"graphql": "^16.9.0",
"@whatwg-node/server": "^0.9.14"
},
"devDependencies": {
"@vitejs/plugin-react": "^3.1.0",
"vite": "^4.1.0"
"vite": "^4.1.4"
},
"resolutions": {
"graphql": "15.8.0",
"graphql": "16.9.0",
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/houdini-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"cookies": "^0.8.0",
"estraverse": "^5.3.0",
"express": "^4.18.2",
"graphql": "^15.8.0",
"graphql": "^16.9.0",
"graphql-yoga": "^4.0.4",
"houdini": "workspace:^",
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
"react-streaming-compat": "^0.3.18",
"recast": "^0.23.1",
"rollup": "^3.7.4",
"rollup": "^3.27.1",
"use-deep-compare-effect": "^1.8.1"
},
"files": [
Expand Down
6 changes: 3 additions & 3 deletions packages/houdini-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"@sveltejs/kit": "^1.9.3",
"ast-types": "^0.16.1",
"estree-walker": "^3.0.1",
"graphql": "^15.8.0",
"graphql": "^16.9.0",
"houdini": "workspace:^",
"recast": "^0.23.1",
"rollup": "^3.7.4",
"rollup": "^3.27.1",
"svelte": "^3.57.0",
"vite": "^4.1.1"
"vite": "^4.1.4"
},
"files": [
"build"
Expand Down
25 changes: 12 additions & 13 deletions packages/houdini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,44 @@
"typedefs": "scripts typedefs"
},
"devDependencies": {
"@babel/types": "^7.21.5",
"@babel/types": "^7.25.4",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@types/glob": "^8.0.0",
"@types/minimatch": "^5.1.2",
"@types/node": "^18.7.23",
"@types/node": "^18.19.46",
"@types/ungap__structured-clone": "^0.3.0",
"kleur": "^4.1.5",
"prettier": "^2.8.3",
"rollup": "^3.7.4",
"rollup": "^3.27.1",
"scripts": "workspace:^",
"vite": "^4.1.4",
"vitest": "^1.6.0"
},
"dependencies": {
"@babel/parser": "^7.23.9",
"@babel/parser": "^7.25.4",
"@clack/prompts": "^0.6.3",
"@graphql-tools/merge": "^9.0.0",
"@graphql-tools/merge": "^9.0.6",
"@graphql-tools/schema": "^9.0.4",
"@kitql/helpers": "^0.8.2",
"@kitql/helpers": "^0.8.10",
"@types/estree": "^1.0.0",
"@types/fs-extra": "^9.0.13",
"@types/micromatch": "^4.0.2",
"@ungap/structured-clone": "^1.0.2",
"@whatwg-node/server": "^0.9.14",
"@whatwg-node/server": "^0.9.49",
"ast-types": "^0.16.1",
"commander": "^9.4.0",
"deepmerge": "^4.2.2",
"estree-walker": "^3.0.1",
"estree-walker": "3.0.1",
"fs-extra": "^10.1.0",
"glob": "^8.0.3",
"graphql": "^15.8.0",
"glob": "^8.1.0",
"graphql": "^16.9.0",
"graphql-yoga": "^4.0.4",
"memfs": "^3.4.7",
"micromatch": "^4.0.5",
"micromatch": "^4.0.8",
"minimatch": "^5.1.0",
"node-fetch": "^3.2.10",
"npx-import": "^1.1.3",
"recast": "^0.23.1",
"vite-plugin-watch-and-run": "^1.3.2"
"recast": "^0.23.1"
},
"files": [
"build"
Expand Down
12 changes: 6 additions & 6 deletions packages/houdini/src/codegen/transforms/componentFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ export default async function componentFields(
const args: graphql.ArgumentNode[] = []
for (const arg of node.arguments ?? []) {
args.push({
kind: 'Argument',
kind: graphql.Kind.ARGUMENT,
name: {
kind: 'Name',
kind: graphql.Kind.NAME,
value: arg.name.value,
},
value: arg.value,
})
}
if (args.length > 0) {
directives.push({
kind: 'Directive',
kind: graphql.Kind.DIRECTIVE,
name: {
kind: 'Name',
kind: graphql.Kind.NAME,
value: config.withDirective,
},
arguments: args,
Expand All @@ -67,9 +67,9 @@ export default async function componentFields(

// replace the field with a fragment spread
return {
kind: 'FragmentSpread',
kind: graphql.Kind.FRAGMENT_SPREAD,
name: {
kind: 'Name',
kind: graphql.Kind.NAME,
value: fragment,
},
directives,
Expand Down
19 changes: 10 additions & 9 deletions packages/houdini/src/codegen/transforms/fragmentVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export type FragmentArgument = {
name: string
type: graphql.TypeNode
required: boolean
defaultValue: graphql.ValueNode | null
defaultValue: graphql.ConstValueNode | null
}

export function fragmentArguments(
Expand Down Expand Up @@ -369,7 +369,8 @@ export function fragmentArguments(

let type = parseArgumentTypeString(typeArg.value)
let defaultValue =
arg.value.fields?.find((arg) => arg.name.value === 'default')?.value || null
(arg.value.fields?.find((arg) => arg.name.value === 'default')
?.value as graphql.ConstValueNode) || null

return [
{
Expand All @@ -396,7 +397,7 @@ export function parseArgumentTypeString(input: string): graphql.TypeNode {
}

return {
kind: 'NonNullType',
kind: graphql.Kind.NON_NULL_TYPE,
type: inner,
}
}
Expand All @@ -406,16 +407,16 @@ export function parseArgumentTypeString(input: string): graphql.TypeNode {
const inner = parseArgumentTypeString(input.substring(1, input.length - 1))

return {
kind: 'ListType',
kind: graphql.Kind.LIST_TYPE,
type: inner,
}
}

// we are dealing with a name
return {
kind: 'NamedType',
kind: graphql.Kind.NAMED_TYPE,
name: {
kind: 'Name',
kind: graphql.Kind.NAME,
value: input,
},
}
Expand Down Expand Up @@ -521,12 +522,12 @@ export function fragmentArgumentsDefinitions(
// we have a list of the arguments
return args.map<graphql.VariableDefinitionNode>((arg) => {
return {
kind: 'VariableDefinition',
kind: graphql.Kind.VARIABLE_DEFINITION,
type: arg.type,
variable: {
kind: 'Variable',
kind: graphql.Kind.VARIABLE,
name: {
kind: 'Name',
kind: graphql.Kind.NAME,
value: arg.name,
},
},
Expand Down
8 changes: 5 additions & 3 deletions packages/houdini/src/codegen/transforms/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ export default async function addListFragments(
export function connectionSelection(
config: Config,
field: graphql.GraphQLField<any, any>,
type: graphql.GraphQLObjectType,
type: graphql.GraphQLObjectType | graphql.GraphQLInterfaceType,
selection: graphql.SelectionSetNode | undefined
): {
selection: graphql.SelectionSetNode | undefined
type: graphql.GraphQLObjectType
type: graphql.GraphQLObjectType | graphql.GraphQLInterfaceType
connection: boolean
error: string | null
} {
Expand Down Expand Up @@ -419,7 +419,9 @@ export function connectionSelection(

return {
selection: nodeSelection.selectionSet,
type: unwrapType(config, nodeField.type).type as graphql.GraphQLObjectType,
type: unwrapType(config, nodeField.type).type as
| graphql.GraphQLObjectType
| graphql.GraphQLInterfaceType,
connection: true,
error: null,
}
Expand Down
33 changes: 18 additions & 15 deletions packages/houdini/src/codegen/transforms/paginate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export default async function paginate(config: Config, documents: Document[]): P
kind: graphql.Kind.NAME,
value: refetchQueryName,
},
operation: 'query',
operation: graphql.OperationTypeNode.QUERY,
variableDefinitions: requiredArgs
.map(
(arg) =>
Expand Down Expand Up @@ -688,7 +688,7 @@ function objectNode([type, defaultValue]: [
string,
number | string | undefined
]): graphql.ObjectValueNode {
const node = {
const node: graphql.ObjectValueNode = {
kind: graphql.Kind.OBJECT,
fields: [
{
Expand All @@ -702,19 +702,22 @@ function objectNode([type, defaultValue]: [
value: type,
},
},
] as graphql.ObjectFieldNode[],
}

// if there's a default value, add it
if (defaultValue) {
node.fields.push({
kind: graphql.Kind.OBJECT_FIELD,
name: { kind: graphql.Kind.NAME, value: 'default' } as graphql.NameNode,
value: {
kind: typeof defaultValue === 'number' ? 'IntValue' : 'StringValue',
value: defaultValue.toString(),
},
} as graphql.ObjectFieldNode)
...(defaultValue
radiden marked this conversation as resolved.
Show resolved Hide resolved
? ([
{
kind: graphql.Kind.OBJECT_FIELD,
name: { kind: graphql.Kind.NAME, value: 'default' },
value: {
kind:
typeof defaultValue === 'number'
? graphql.Kind.INT
: graphql.Kind.STRING,
value: defaultValue.toString(),
},
},
] as graphql.ObjectFieldNode[])
: []),
],
}

return node
Expand Down
Loading