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

Automatically generate enums for GraphType members based on the AST or Reflection #37

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

JKamsker
Copy link

No description provided.

{
var result = base
.Field(name, expression, nullable, type)
.WithOriginalName(expression.NameOf())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See graphql-dotnet/graphql-dotnet#1107, it will be better to use already implemented features.

Copy link
Author

@JKamsker JKamsker Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I have to use it? It wasn't "already implemented" when i initially did this last Winter.
Edit: Can't use the new feature as it uses an older version of graphql-net and im unable to upgrade it without causing a webserver failure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even after #38 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ORIGINAL_EXPRESSION_PROPERTY_NAME now internal, OK, I'll see what I can do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm okay didn't notice the update, sorry my fault :D
But my solution still needs the sourcetype

Copy link
Author

@JKamsker JKamsker Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

).AddRange(DefaultQueryArguments.SkipTakeOrderByArguments<HumanType>()),
resolve: context =>
{
var skipTakeArgs = SkipTakeOrderByArgument.Parse(context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable

Func<ResolveFieldContext, string, object> func = (context, id) => data.GetDroidByIdAsync(id);
Func<ResolveFieldContext, string, object> func = (context, id) =>
{
var skipTakeArgs = SkipTakeOrderByArgument.Parse(context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable

@JKamsker
Copy link
Author

JKamsker commented Mar 3, 2020

Implemented Own method for "Humans" to demonstrate the Usecase for the SkipTakeOrderBy class which contains the auto enum type

@JKamsker
Copy link
Author

News?

@sungam3r
Copy link
Member

Located somewhere at the top of my to-do list. While there is no time to do this closely. I remember that in the first review I was thinking of moving part of the code from this PR to the main project.

@JKamsker
Copy link
Author

Thanks for the update!

@Shane32
Copy link
Member

Shane32 commented Apr 23, 2023

@sungam3r Let's merge this as an example, either as-is, or as a separate example, rather leaving it as a perpetual PR.

@sungam3r
Copy link
Member

I remember this one. Give me some time to dive into details. IIRC I had an idea to move it into core repo at least part of it. I can take care about conflicts.

@JKamsker
Copy link
Author

@sungam3r Have you got updates?

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