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.

Extended enum values are not recognized

See original GitHub issue

I really appreciate this plugin and I’m not trying to be a bother with opening issues left and right, but I did notice another thing about enums.

Version and Environment Details

Operation system: macOS Mojave 10.14.6

IDE name and version: Webstorm 2019.2.3

Plugin version: 2.2.0

Expected Behaviour

When extending an enum type by extend enum MyEnum {EXTRA_VALUE}, the plugin should correctly recognize EXTRA_VALUE as a value of MyEnum.

Actual Behaviour

The plugin displays an error for every value which is not present in the original definition of the enum.

Screen Shot 2019-10-16 at 6 53 23 PM

Steps to Reproduce / Link to Repo with Reproduction and Instructions

type User {
  id: ID
  email: String
}

enum AuthRoles {
  USER
  CREW
  ADMIN
}

extend enum AuthRoles {
  AUTHENTICATED
  CURRENT_USER
  OR
  AND
  NOT
}

type Query {
  getUser(id: ID!): User @auth(if: [ADMIN OR CREW OR CURRENT_USER])
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
clementohNZcommented, May 10, 2021

+1

0reactions
vepanimascommented, Nov 19, 2021

Fixed in 3.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extended enum values are not recognized · Issue #293 - GitHub
When extending an enum type by extend enum MyEnum {EXTRA_VALUE} , the plugin should correctly recognize EXTRA_VALUE as a value of MyEnum ....
Read more >
c# - Enum Extension Method is not showing - Stack Overflow
Extension methods can be applied on instances only public static class EnumExtensions { // This extension method requires "value" argument ...
Read more >
Problem with List<Enum> Extension - MSDN - Microsoft
Hello,. I have the following extension: public static SelectList ToSelectList(this IEnumerable<Enum> source) { } // ToSelectList.
Read more >
How to extend enums in TypeScript - LogRocket Blog
Can you extend enums? The short answer is no, you can't extend enums because TypeScript offers no language feature to extend them. However, ......
Read more >
Extending Enums in Java - Baeldung
In this tutorial, we'll discuss extending enums in Java, including adding new constant values and new functionalities.
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