-
Notifications
You must be signed in to change notification settings - Fork 6
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
Multiple types named "PageInfo" #27
Comments
Hey. What does your schema looks like before using AutoRelay? If you already have a type named PageInfo this will cause graphql to throw that error when AutoRelay tries to create its own PageInfo. |
I disabled anything except the above query. So step by step, if I use the following code and do not configure auto-relay, I get the following schema: @Authorized([UserRole.ADMIN])
@Query(() => [User], { description: "Return all users. Permission: ADMIN." })
async allUsers(): Promise<User[]> {
return await User.find();
} scalar DateTime
type Query {
allUsers: [User!]!
}
type User {
uuid: ID!
username: String!
fullname: String!
role: String!
createdAt: DateTime!
lastLoginAt: DateTime
} After enabling auto relay in the index.ts, the schema changes to the following: new AutoRelayConfig({ orm: () => TypeOrmConnection }) input ConnectionArgs {
"""Paginate before opaque cursor"""
before: String
"""Paginate after opaque cursor"""
after: String
"""Paginate first"""
first: Int
"""Paginate last"""
last: Int
}
scalar DateTime
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
type Query {
allUsers: [User!]!
}
type User {
uuid: ID!
username: String!
fullname: String!
role: String!
createdAt: DateTime!
lastLoginAt: DateTime
} If I now change my Query to the initially provided code snippet, I get the said error. So I don't think that there are any types called PageInfo in my schema except the one auto-relay includes on its own. |
Hello, I encountered the same issue. |
I'm having trouble creating a Relay'd Query like shown in this example.
My code is the following:
I had to change
Promise<[number, User[]]>
toPromise<[User[], number]>
because typeorm returns it the other way around, but I don't think thats the cause of the problem.During startup I get the following error:
I have not touched other queries except the above. The only other additions I made are the configuration steps in index.ts.
Is this somehow linked to #16 and the
undefinedPageInfo type
? Am I missing something? Any help very much appreciated!The text was updated successfully, but these errors were encountered: