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

v17 Roadmap #4205

Open
10 of 17 tasks
yaacovCR opened this issue Sep 27, 2024 · 4 comments
Open
10 of 17 tasks

v17 Roadmap #4205

yaacovCR opened this issue Sep 27, 2024 · 4 comments

Comments

@yaacovCR yaacovCR pinned this issue Sep 27, 2024
@jasonkuhrt
Copy link

jasonkuhrt commented Oct 2, 2024

Wonder if we could make the node types not read-only anymore? Wouldn't be a breaking change. Guessing there is a good reason for how it is now, but maybe not?

See #4212

@benjie
Copy link
Member

benjie commented Feb 27, 2025

Not sure if this is the best place for this, but here are some spec changes that I think we should aim to hit the V17 version; some of them are already merged:

@JoviDeCroock
Copy link
Member

use arrays to reference them in some places

Yes currently we allow for inputs to be done with the object syntax but we translate them to arrays in a lot of places. I think mainly to make introspection easier but that's not a great reason, we should change this.

graphql/graphql-spec#976 / I'm not sure if this actually needs anything to change in GraphQL.js TBH.

Unless this becomes part of the validate/execute phase we don't need any changes here.

@benjie
Copy link
Member

benjie commented Mar 20, 2025

Unless this becomes part of the validate/execute phase we don't need any changes here.

That was my initial thought too. Just looking around the codebase, I see ExecutionResult has extensions:

export interface ExecutionResult<
TData = ObjMap<unknown>,
TExtensions = ObjMap<unknown>,
> {
errors?: ReadonlyArray<GraphQLError>;
data?: TData | null;
extensions?: TExtensions;
}

Perhaps GraphQLArgs should have this too:

export interface GraphQLArgs {
schema: GraphQLSchema;
source: string | Source;
hideSuggestions?: Maybe<boolean>;
rootValue?: unknown;
contextValue?: unknown;
variableValues?: Maybe<{ readonly [variable: string]: unknown }>;
operationName?: Maybe<string>;
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
abortSignal?: Maybe<AbortSignal>;
}

And maybe even ExecutionArgs:

export interface ExecutionArgs {
schema: GraphQLSchema;
document: DocumentNode;
rootValue?: unknown;
contextValue?: unknown;
variableValues?: Maybe<{ readonly [variable: string]: unknown }>;
operationName?: Maybe<string>;
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
}

This would be a type only change, but I imagine it allows for things like envelop to augment/read from extensions which may be useful. Maybe explicitly passing extensions from GraphQLArgs through to ExecutionArgs would be the one concrete (non-type) code change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants