-
Notifications
You must be signed in to change notification settings - Fork 49
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
Graphql query to Fetch data between dates(_Neo4jLocalDateTime), #223
Comments
This is related to #93 - the response states that "This type of filtering for temporal types is not yet implemented and there is currently no workaround to get it working." However, it is possible to workaround it (with an obvious drawback around field selection) by declaring a custom
And then query as:
I've used |
Hi Robin Bramley,
Thanks for the response. Let me try like this
Thanks
…On Thu, May 20, 2021 at 7:25 PM Robin Bramley ***@***.***> wrote:
This is related to #93
<#93> - the
response states that "*This type of filtering for temporal types is not
yet implemented and there is currently no workaround to get it working.*"
However, it is possible to workaround it (with an obvious drawback around
field selection) by declaring a custom @cypher query in your schema e.g.
movieDateFiltered(after: _Neo4jDateInput, before: _Neo4jDateInput): [Movie] @cypher(
statement: "MATCH (m:Movie) WHERE m.pub_date >= date(after) AND m.pub_date <= date(before) RETURN { title: m.title, pub_date: m.pub_date }")
And then query as:
query {
movieDateFiltered(
after: {year:2016, month:12, day:31},
before: {year:2020, month:1, day:1}
)
{
title
pub_date { formatted }
}
}
I've used _Neo4jDate for simplicity, but you should be able to extend the
same approach for datetimes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLUJIBIJTWMAYPPQ3XRHSLTOUIEHANCNFSM444MWOFA>
.
|
If you're on Java 11 and happy to compile a 1.3.1-SNAPSHOT build, I've made a pull request for an initial implementation of date/time filtering. If you're on Java 8, I've got a variant of that PR that I'm trialling, but it's on a branch created from the 1.2.1(-SNAPSHOT) codebase of 25th March 2021 / commit 0f89393 before the update to Neo4j 4.2. I've not yet pushed that to my fork though. |
How can we write a Graphql query to fetch data between 2 different dates.? Date property that we use has datatype _Neo4jLocalDateTime.
The text was updated successfully, but these errors were encountered: