Prisma1: Pagination ERROR

Created on 16 May 2018  路  5Comments  路  Source: prisma/prisma1

Query :

PostsConnection(first:10, after: "cjh8tgfdq000509687o4e68wc", where: {isPublished:true}){
pageInfo{hasNextPage endCursor}
edges {node{
id
title
isPublished
}}

Container LOGS ( database_postgres_1 ):

2018-05-16 11:35:02.123 UTC [702] STATEMENT: select * from "default$default"."Post" where ( ( "Post" ."isPublished" = $1 ) and ("default$default"."Post"."i", "default$default"."Post"."i") > ((select "default$default"."Post"."i" from default$default.Post where "default$default"."Post"."i" = 'cjh8tgfdq000509687o4e68wc'), 'cjh8tgfdq000509687o4e68wc') ) order by "default$default"."Post"."id"

Container LOGS ( database_prisma_1 ) :

[Bugsnag - local / testing] Error report: com.bugsnag.Report@1467efa3
org.postgresql.util.PSQLException: ERROR: column Post.i does not exist
Position: 102
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:144)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at slick.jdbc.StatementInvoker.results(StatementInvoker.scala:39)
at slick.jdbc.StatementInvoker.iteratorTo(StatementInvoker.scala:22)
at slick.jdbc.Invoker.foreach(Invoker.scala:48)
at slick.jdbc.Invoker.foreach$(Invoker.scala:47)
at slick.jdbc.StatementInvoker.foreach(StatementInvoker.scala:16)
at slick.jdbc.StreamingInvokerAction.run(StreamingInvokerAction.scala:22)
at slick.jdbc.StreamingInvokerAction.run$(StreamingInvokerAction.scala:20)
at slick.jdbc.SQLActionBuilder$$anon$1.run(StaticQuery.scala:98)
at slick.jdbc.SQLActionBuilder$$anon$1.run(StaticQuery.scala:98)
at slick.basic.BasicBackend$DatabaseDef$$anon$2.liftedTree1$1(BasicBackend.scala:240)
at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:240)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)


images:

bu2-confirmed areconnector areconnectopostgres

Most helpful comment

Hey @salim-dev thanks for reporting this.

I just looked into it. While the issue is currently still affecting the stable 1.9 release, some work we have done since then on pagination already fixed this on 1.10 beta. So a fix will be available in a little over a week once the 1.10 beta gets promoted to stable.

All 5 comments

the mistake comes when we add the parameter "after: xxxxxxxxxxx"

Hey @salim-dev, thanks for the report. How does your datamodel look like?

Hey @marktani

type Post {
id: ID!
createdAt: DateTime!
updatedAt: DateTime!
title: String!
content: String!
author: User!
isPublished: Boolean @default(value: false)
}

type User {
id: ID!
role: ROLE @default(value: CONTRIBUTOR)
createdAt: DateTime!
updatedAt: DateTime!
posts: [Post!]

}
enum ROLE {
ADMIN
EDITOR
CONTRIBUTOR
}

Thank !!

Hey @salim-dev thanks for reporting this.

I just looked into it. While the issue is currently still affecting the stable 1.9 release, some work we have done since then on pagination already fixed this on 1.10 beta. So a fix will be available in a little over a week once the 1.10 beta gets promoted to stable.

Closing since it is available since 1.10

Was this page helpful?
0 / 5 - 0 ratings