Repository navigation
Question: how to make property non-required in GraphQl schema #5139
Replies: 8 comments
|
I know I can change method name to |
|
You can use serialization groups to "hide" methods or properties: |
|
@alanpoulain thanks for an answer. |
|
I think you have to make the parameter of the method nullable then. Either: |
|
@alanpoulain, I tried both - doesn't work. Field is still mandatory. Yes, if I will not use one of special words "get", "add", "has", "is" , the method will not be recognized like a virtual property and schema builder just skip it. But I think you answered my question - I have a few ways how to avoid this problem and I know that I didnt miss something. Hope this will be enough for me. Thanks! |
|
But anyway may be this will be good if schema builder will respect method's annotations and parameters. |
|
I don't think it's an issue with the schema builder. Maybe with the property metadata factory. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I have an entity with method like
addToLogs(LogEntity $logEntity).Schema builder recognizes it like a property
toLogsand makes it mandatory. How to solve this issue properly?Thanks.
All reactions