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

Expose getArgumentValues from root #2719

Closed
thomas-jeepe opened this issue Jul 24, 2020 · 7 comments · Fixed by #3464 or #3487
Closed

Expose getArgumentValues from root #2719

thomas-jeepe opened this issue Jul 24, 2020 · 7 comments · Fixed by #3464 or #3487

Comments

@thomas-jeepe
Copy link

getArgumentValues is marked as internal and only exposed when you import from graphql/execution/values.

If you could expose it from the root index.js it would make importing it far easier in contexts without imports to relative files (a cdn for my case.)

The function is already used in production ready code in joinmonster and is necessary to get arguments from resolve info in field handlers. I don't see a good reason not to expose it.

@hayes
Copy link
Contributor

hayes commented Jul 29, 2021

I've seen several places that either use getArgumentValues, or suggest using it. Is there a reason it is currently not exposed from the index? Happy to make a PR if it's just an oversight

@benjie
Copy link
Member

benjie commented Jan 6, 2022

@IvanGoncharov do you know if there is a good reason for this to be internal only?

From what I can tell it receives a fair bit of use from the community, and it seems a bit too complex to just copy and paste into a project.

We're currently facing issues with there being no TypeScript declaration for this export, which is preventing us adopting GraphQL v16:

src/index.ts:20:10 - error TS2305: Module '"graphql"' has no exported member 'getArgumentValues'.

20 import { getArgumentValues } from "graphql/execution/values";
            ~~~~~~~~~~~~~~~~~


Found 1 error.

Surfacing this as a top level export would be appreciated 👍

@sachaw
Copy link

sachaw commented Jan 17, 2022

Is there any plans to work around this, It's currently blocking upgrading a number of large projects for me, and is starting to become a problem.
Thanks.

@IvanGoncharov
Copy link
Member

@benjie @sachaw TS error that you experience should be fixed by c2435fd#diff-8fa9d179bb9179cc71534c34c492beb7bd8742db13f0fa1b6b269b5dc726a7f3
and released as [email protected].
Can you please test updating directly to 16.2.0?

As for exporting getArgumentValues it's internal function and was never intended to be part of public API.
However, since there are no alternatives to achieve the same functionality getArgumentValues defacto became part of public API.
So I will expose it, however, long-term solution would be to design it as a separate stage of the execution pipeline (similar to validate for example) so please expect breaking change in the next major release.

IvanGoncharov added a commit to IvanGoncharov/graphql-js that referenced this issue Jan 26, 2022
@saihaj saihaj reopened this Jan 27, 2022
@saihaj
Copy link
Member

saihaj commented Jan 27, 2022

@IvanGoncharov as discussed in WG today incorrect function was exposed.

@hiepxanh
Copy link

hiepxanh commented Feb 8, 2022

hope this will be resolve soon, I really expect this issue will be resolve since I'm using postgraphile and stuck with graphql version 15 for a long time :D

@paulbijancoch
Copy link

any news on this?

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