Repository navigation
Conversation
added generics to StaticDataFetcher
bbakerman
left a comment
There was a problem hiding this comment.
The naming changes would be great
| Map<Object,Object> getExtensions(); | ||
| Map<Object, Object> getExtensions(); | ||
|
|
||
| ExecutionResult toMap(); |
There was a problem hiding this comment.
Can we call this toSpecification() please
| } | ||
|
|
||
|
|
||
| private static class ExecutionResultWithoutErrors implements ExecutionResult { |
2. Added javadoc
|
changed names and added Javadoc to toSpecification() |
andimarek
left a comment
There was a problem hiding this comment.
@bbakerman your thoughts about extensions?
| List<GraphQLError> getErrors(); | ||
|
|
||
| Map<Object,Object> getExtensions(); | ||
| Map<Object, Object> getExtensions(); |
There was a problem hiding this comment.
I think we should remove this: graphql-java doesn't support it currently and ExecutionResult should be immutable imho.
There was a problem hiding this comment.
Well, I use extension in my work, so I prefer to leave it as it is.
Also, I think it is better not to delete it and maybe do a //TODO.
About the immutable, it is better to do it immutable after graphql-java supports extension, that way people that do use extensions (like me) don't need to make another instance.
But even if you think I'm wrong, I think it's for another PR, don't you?
There was a problem hiding this comment.
@guy120494 could you describe your use case? thanks!
There was a problem hiding this comment.
On second thought, In my work we construct our own object to be sent as a response, so we don't use this getExtensions() method.
Nevertheless, make a PR that supports extensions is better than delete this method and maybe forget about it later in the future.
But again, I think this discussion belongs to another PR, because this is not the topic about this PR as i see it. If you want me to remove this method an accept this PR, I would be happy to do so
There was a problem hiding this comment.
@andimarek - the spec says:
The
response map may also contain an entry with key extensions. This entry, if set, must have a map as its value. This entry is reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents.
So since graphql-java (the implementor) does not use it then I would remove it until some one comes up with a good use case for it.
And perhaps we should have a ExecutionResultBuilder so that it ExecutionResult can be immutable more easily
There was a problem hiding this comment.
@bbakerman yes, this is what I meant: it is reserved for the server implementation do something with it and currently we don't use it. And on top of that it is just strange to have such a map, but it never used.
@guy120494 Thanks for your feedback. I agree it is a separate PR.
2. Added javadoc
# Conflicts: # src/main/java/graphql/ExecutionResult.java # src/main/java/graphql/ExecutionResultImpl.java # src/main/java/graphql/execution/ExecutionStrategyParameters.java # src/main/java/graphql/execution/instrumentation/parameters/InstrumentationDataFetchParameters.java # src/main/java/graphql/execution/instrumentation/parameters/InstrumentationExecutionParameters.java # src/main/java/graphql/execution/instrumentation/parameters/InstrumentationFieldFetchParameters.java # src/main/java/graphql/execution/instrumentation/parameters/InstrumentationFieldParameters.java # src/main/java/graphql/execution/instrumentation/parameters/InstrumentationValidationParameters.java
|
can this PR be merged? or do I need to fix anything else? |
|
@guy120494 sorry for the delay. I get the idea that we should make it easy to conform to the spec, but in general we don't support any specific json libraries. I think the best thing would be to just return a real |
|
@andimarek but all JSON libraries respect the "transient" keyword, don't they? |
|
@guy120494 yes, but I think a |
|
Closing and re-implenting via #552 |
implemented @bbakerman idea to issue #473 and added a toMap() method.
(and also added generics to StaticDataFethcer)