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

GraphQL Support #377

Open
danielehrhardt opened this issue Nov 10, 2020 · 5 comments
Open

GraphQL Support #377

danielehrhardt opened this issue Nov 10, 2020 · 5 comments

Comments

@danielehrhardt
Copy link

Is there any way to use this with GraphQL?
Currently, i am not able to select the correct Query Return Object

@bashleigh
Copy link
Collaborator

bashleigh commented Nov 17, 2020

I've honestly not looked at graphQL much. Could you provide an example of how you would create a paginated result with typeORM please? :) I'm guessing the query would look something like this

const query = repository.queryBuilder()
  .select(requiredProperties)
  .where(matching)
  .limit(limitFromQL)
  .from()// last index?

const [count, results] = Partial<MyEntity> query.getManyAndCount();

@rifatdover
Copy link

I think it should be a relay connection not a pagination.

@bashleigh
Copy link
Collaborator

After working with GraphQL for a bit, I think it would be possible to set this up and @rifatdover you're right, it would be a relay connection. I'll see what I can do!

@tamert
Copy link

tamert commented May 27, 2021

@SebaBoler
Copy link

SebaBoler commented Mar 3, 2023

It's works. I have many queries with return

paginate<Entity>(this.repository, optionLimit, queryOptions)

All queries have option IPaginationOption, filters ( custom field ) and sort by any field from Entity

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

5 participants