-
Notifications
You must be signed in to change notification settings - Fork 0
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 for GraphQL 5 #17
Conversation
@sungam3r The new features in the GraphQL v5 (mostly the |
|
||
namespace Sample | ||
{ | ||
public class RequiredAttribute : GraphQL.GraphQLAttribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move into core repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh... we could. With NRT it's pretty pointless, but it probably depends on how it's actually used. I had RequiredAttribute
, OptionalAttribute
, RequiredListAttribute
and OptionalListAttribute
with a pile of tests for each written here previously. It is extremely easy to rewrite these attributes if they are needed with the new way the attributes are applied ( nice teamwork here 👍 👍 👍 ) . I just didn't feel like updating the sample project in this repo, so I just moved the class over to the sample project.
So, to answer your question, I wouldn't. But if you think so, sure.
There is two attributes I think we should consider adding:
- An attribute that sets the 'base' graph type (i.e. the graph type of the base clr type) without having to apply the list/non-null wrappers. (Right now the
InputType
orOutputType
attributes overwrite the entire graph type, so any list/non-null wrappers need to be specified in the attribute.) - A couple special attributes for date or timespan fields to define which exact graph type was intended.
Btw, I did try to eliminate the need for this project altogether, but I found that my code works very well with the DI-injection supported here, so I'm still using it. It is rather nice being able to DI-inject services into the constructor of mutation graphs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that it would be useful to fill the main project with additional attributes even as examples and even if these attributes will be rarely in demand.
No description provided.