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

Update assets.ex #286

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Update assets.ex #286

merged 1 commit into from
Nov 23, 2023

Conversation

besedin
Copy link
Contributor

@besedin besedin commented Jul 13, 2023

The main point of the update is bugs in graphiql-workspace 1.1.4 and fixes in version 1.1.5.

For example, the default values of custom scalars are always displayed as false instead of the actual value, because issue in function:

 function buildScalarDef(scalarIntrospection) {
    return new _definition.GraphQLScalarType({
      name: scalarIntrospection.name,
      description: scalarIntrospection.description,
      serialize: function serialize(id) {
        return id;
      },
      // Note: validation calls the parse functions to determine if a
      // literal value is correct. Returning null would cause use of custom
      // scalars to always fail validation. Returning false causes them to
      // always pass validation.
      parseValue: function parseValue() {
        return false;
      },
      parseLiteral: function parseLiteral() {
        return false;
      }
    });
  }

This bug has been fixed in version 1.1.5.

In this PR:

  • updated the graphiql-workspace asset from version 1.1.4 to version 1.1.5

Upgrade graphiql-workspace to v1.1.5
@benwilson512 benwilson512 merged commit 3a984cc into absinthe-graphql:main Nov 23, 2023
@kelostrada
Copy link

Does this work for you guys? After updating graphiql-workspace I get console errors

graphiql-workspace.min.js:20 Uncaught Error: Cannot use e "__Schema" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
    at exports.default (graphiql-workspace.min.js:20:11303)
    at isScalarType (graphiql-workspace.min.js:21:31533)
    at isType (graphiql-workspace.min.js:21:31216)
    at isNullableType (graphiql-workspace.min.js:22:2917)
    at assertNullableType (graphiql-workspace.min.js:22:2984)
    at new GraphQLNonNull (graphiql-workspace.min.js:22:2624)
    at GraphQLNonNull (graphiql-workspace.min.js:22:2647)
    at 280.../jsutils/isInvalid (graphiql-workspace.min.js:23:8670)
    at o (graphiql-workspace.min.js:1:582)
    at graphiql-workspace.min.js:1:633
exports.default @ graphiql-workspace.min.js:20
isScalarType @ graphiql-workspace.min.js:21
isType @ graphiql-workspace.min.js:21
isNullableType @ graphiql-workspace.min.js:22
assertNullableType @ graphiql-workspace.min.js:22
GraphQLNonNull @ graphiql-workspace.min.js:22
GraphQLNonNull @ graphiql-workspace.min.js:22
280.../jsutils/isInvalid @ graphiql-workspace.min.js:23
o @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
283.../error/GraphQLError @ graphiql-workspace.min.js:23
o @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
246../execution/execute @ graphiql-workspace.min.js:19
o @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
247../error @ graphiql-workspace.min.js:19
o @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:15
193.../utility/CodeMirrorSizer @ graphiql-workspace.min.js:15
o @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
3../DebouncedFormControl @ graphiql-workspace.min.js:1
o @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
10../GraphiQLTab @ graphiql-workspace.min.js:2
o @ graphiql-workspace.min.js:1
r @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1
(anonymous) @ graphiql-workspace.min.js:1Understand this errorAI
graphiql:46 Uncaught ReferenceError: graphiqlWorkspace is not defined
    at graphiql:46:18

@besedin
Copy link
Contributor Author

besedin commented Dec 10, 2024

@kelostrada I'm sure it worked at the time of publishing, however now, got the same errors you wrote about. Anyway, I believe the problem so far is with the minified version of graphiql-workspace.js, so you can modify assets.ex:46 to use the unminified version as follows

{ “graphiql-workspace.js”, “graphiql-workspace.js”}

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

Successfully merging this pull request may close these issues.

3 participants