Skip to content
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

Page start 0 throws exception #27

Closed
whyserkan opened this issue Jan 2, 2018 · 2 comments
Closed

Page start 0 throws exception #27

whyserkan opened this issue Jan 2, 2018 · 2 comments

Comments

@whyserkan
Copy link

whyserkan commented Jan 2, 2018

Hi,
Thanks for this library, I have one issue if I send start value 0 I get :
request:

query {
  Applications(page: {start: 0, limit: 3}){
    select {
      longName
    }
    pages 
  }
}
{
  "data": {
    "Applications": null
  },
  "errors": [
    {
      "message": "Exception while fetching data (/Applications) : Negative value (-3) passed to setFirstResult",
      "path": [
        "Applications"
      ],
      "exception": {
        "cause": null,
        "stackTrace": [
          {
            "methodName": "setFirstResult",
            "fileName": "BaseQueryImpl.java",
            "lineNumber": 105,
            "className": "org.hibernate.jpa.spi.BaseQueryImpl",
            "nativeMethod": false
          },
          {
            "methodName": "setFirstResult",
            "fileName": "AbstractQueryImpl.java",
            "lineNumber": 84,
            "className": "org.hibernate.jpa.spi.AbstractQueryImpl",
            "nativeMethod": false
          },
          {
            "methodName": "setFirstResult",
            "fileName": "CriteriaQueryTypeQueryAdapter.java",
            "lineNumber": 71,
            "className": "org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter",
            "nativeMethod": false
          },
          {
            "methodName": "get",
            "fileName": "GraphQLJpaQueryDataFetcher.java",
            "lineNumber": 103,
            "className": "com.introproventures.graphql.jpa.query.schema.impl.GraphQLJpaQueryDataFetcher",
            "nativeMethod": false
          },
          {
            "methodName": "fetchField",
            "fileName": "ExecutionStrategy.java",
            "lineNumber": 219,
            "className": "graphql.execution.ExecutionStrategy",
            "nativeMethod": false
          },
        

I can add full response too.
We are calling with start value 1, works fine just not follwing your readme.
Cheers

@igdianov
Copy link
Collaborator

igdianov commented Jan 8, 2018

@whyserkan Thank you for reporting an issue. Sorry for delay in reply - I am away on holiday at the moment.

The page start parameter value is 1-based, see GraphQLJpaQueryDataFetcher.java#L103 and StarwarsQueryExecutorTests.java#L269

I have updated the README to avoid the confusion.

@whyserkan
Copy link
Author

Thank you @igdianov ,
One more thing,
As I see 'NE' is generating a 'like' statement instead of a 'not equals'.
Can you check it when you have time?
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants