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

Strawberry Shake generated client code does not include enums that start with an underscore "_" #7638

Closed
dmgm80 opened this issue Oct 21, 2024 · 2 comments
Labels
🐾 duplicate This issue or pull request already exists 🌶️ strawberry shake

Comments

@dmgm80
Copy link

dmgm80 commented Oct 21, 2024

Product

Strawberry Shake

Version

13.9.14

Link to minimal reproduction

none

Steps to reproduce

Enums that start with an underscore seems to be problematic. For example,

public enum AccountType 
{
    _401k
} 

I see it in the schema but not in the strawberryshake generated code and I get a build error.

What is expected?

I expect to see public enum AccountType { _401k } in the strawberry shake generated code

What is actually happening?

Exists in the schema

enum AccountType {
  _401_K 
}

Enum doesn't exist in in the strawberry shake generated code.

Also a build error occurs with this error.

Unhandled exception. System.AggregateException: One or more errors occurred. (The specified name is not a valid GraphQL name. (Parameter 'name'))
---> System.ArgumentException: The specified name is not a valid GraphQL name. (Parameter 'name')
at HotChocolate.Utilities.NameUtils.EnsureGraphQLName(String name, String argumentName) in /home/runner/work/graphql-platform/graphql-platform/src/HotChocolate/Core/src/Abstractions/Utilities/NameUtils.cs:line 38
at StrawberryShake.CodeGeneration.Analyzers.Models.EnumValueModel..ctor(String name, String description, IEnumValue value, String underlyingValue) in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/Models/EnumValueModel.cs:line 18
at StrawberryShake.CodeGeneration.Analyzers.DocumentAnalyzer.CollectEnumTypes(IDocumentAnalyzerContext context) in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/DocumentAnalyzer.CollectEnumTypes.cs:line 30
at StrawberryShake.CodeGeneration.Analyzers.DocumentAnalyzer.CreateOperationModel(IDocumentAnalyzerContext context) in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/DocumentAnalyzer.CollectOutputTypes.cs:line 17
at StrawberryShake.CodeGeneration.Analyzers.DocumentAnalyzer.AnalyzeAsync() in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/DocumentAnalyzer.cs:line 55
at StrawberryShake.CodeGeneration.CSharp.CSharpGenerator.GenerateAsync(IEnumerable1 fileNames, CSharpGeneratorSettings settings) in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/CodeGeneration/src/CodeGeneration.CSharp/CSharpGenerator.cs:line 133
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at StrawberryShake.Tools.GenerateCommand.GenerateCommandHandler.GenerateClient(String clientName, String[] documents, CSharpGeneratorSettings settings) in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/Tooling/src/dotnet-graphql/GenerateCommand.cs:line 164
at StrawberryShake.Tools.GenerateCommand.GenerateCommandHandler.ExecuteAsync(GenerateCommandArguments args, CancellationToken cancellationToken) in /home/runner/work/graphql-platform/graphql-platform/src/StrawberryShake/Tooling/src/dotnet-graphql/GenerateCommand.cs:line 124
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at StrawberryShake.Tools.Program.

(String[] args)

Relevant log output

No response

Additional context

No response

@dmgm80 dmgm80 added the 🐛 bug Something isn't working label Oct 21, 2024
@glen-84 glen-84 added 🐾 duplicate This issue or pull request already exists and removed 🐛 bug Something isn't working labels Oct 22, 2024
@glen-84
Copy link
Collaborator

glen-84 commented Oct 22, 2024

Duplicate of #4771.

@glen-84 glen-84 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@glen-84
Copy link
Collaborator

glen-84 commented Oct 22, 2024

Please try version 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐾 duplicate This issue or pull request already exists 🌶️ strawberry shake
Projects
None yet
Development

No branches or pull requests

2 participants