question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose getArgumentValues from root

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
benjiecommented, 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 👍

6reactions
IvanGoncharovcommented, Jan 26, 2022

@benjie @sachaw TS error that you experience should be fixed by https://github.com/graphql/graphql-js/commit/c2435fd1b8b22e034ad1b266bf092ace0e06d015#diff-8fa9d179bb9179cc71534c34c492beb7bd8742db13f0fa1b6b269b5dc726a7f3 and released as graphql@16.2.0. 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

graphql-tools/utils
Prepares an object map of argument values given a list of argument definitions and list of argument AST nodes. Note: The returned value...
Read more >
sangria-graphql/sangria - Gitter
I'm building a GraphQL endpoint using Sangria. As I develop, I want to play with the endpoint with a client tool. I started...
Read more >
Example usage for org.springframework.beans.factory.config ...
@Nullable public ValueHolder getArgumentValue(int index, @Nullable Class<?> ... Class} will never be exposed to application code) * @return the type for the ...
Read more >
Migrating from v3.x to v4.x - GraphQL .NET
Parent provides access to the parent context (up to the root). ... ApplyToChildren; ExecutionStrategy exposes a number of protected virtual methods that can ......
Read more >
G-Index (Java SE 11 & JDK 11 ) - Oracle Help Center
Exposes the remote management interface of the gauge monitor MBean. ... Returns an XML DOM Node object that represents the root of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found