-
I am currently working on a project where I am using the However, Here is a simple code snippet that demonstrates the issue: ValidationError validationError = ValidationError.newValidationError()
.description("description")
.queryPath(List.of("queryPath"))
.build();
System.out.println(validationError.getPath()); // prints null
System.out.println(validationError.getQueryPath()); // prints [queryPath] In this example, I would expect both Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Sounds unintentional
…On Tue, 7 May 2024, 11:33 pm Jens Kilde Mjelva, ***@***.***> wrote:
I am currently working on a project where I am using the ValidationError
class from the graphql.validation package. I have noticed that the
getPath() method in this class always returns null. This is because
ValidationError does not override the getPath() method from GraphQLError.
However, ValidationError has a separate method getQueryPath(), which
seems to serve a similar purpose. This can lead to confusion, as developers
might expect getPath() to return the query path, but it always returns
null.
Here is a simple code snippet that demonstrates the issue:
ValidationError validationError = ValidationError.newValidationError()
.description("description")
.queryPath(List.of("queryPath"))
.build();
System.out.println(validationError.getPath()); // prints nullSystem.out.println(validationError.getQueryPath()); // prints [queryPath]
In this example, I would expect both getPath() and getQueryPath() to
print [queryPath], but getPath() prints null.
Is this distinction intended, or is it a "bug"?
Best regards,
Jens
—
Reply to this email directly, view it on GitHub
<#3589>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMVWSOX76OR5FTKK6AYABTZBDJ2NAVCNFSM6AAAAABHLAWVTGVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGYZDGMJZGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
So it was done on purpose - but in retrospect I am not sure its heaps of value - but it was done on purpose - it was changed from
getPath
togetQueryPath
.... by me... 6 years ago