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

Limit the number of jobs retrieved on Jobs Query #49

Open
tallysmartins opened this issue Oct 1, 2018 · 5 comments
Open

Limit the number of jobs retrieved on Jobs Query #49

tallysmartins opened this issue Oct 1, 2018 · 5 comments

Comments

@tallysmartins
Copy link
Member

Return just a few of them, not all. Also its needed the support for pagination.

I would say that we can have a limit of 10 jobs by default if the parameter is not given and a max limit of 50 if we want to query more of them. This would affect only the jobs query by now.

@denys-medynskyi
Copy link

Can you point into the code? I can take a look

@tallysmartins
Copy link
Member Author

Hi @denysmedynskyi, thank you for your intereset on this :)

Well, if you take a look at this page you can see how many jobs we list in the page. We would like to limit this to an amount of 10 jobs. For this, we need to change the backend endpoint that fetches the Jobs. This is our schema where we define our endpoints and what function will resolve the query.

Take a look at absynthe documentation for composing GraphQL API endpoints.

@denys-medynskyi
Copy link

So, to verify this is working correct I need to start https://github.com/spawnfest/elixirbench together with this project?

@tallysmartins
Copy link
Member Author

tallysmartins commented Oct 11, 2018

No you don't. If you run just this project you will be able to work on this, write tests and play with the api from yout localhost:4000/api/graphiql, the same as here https://api.elixirbench.org/api/graphiql.

To better understand the relations between jobs and repositories take a look at the examples in the seeds.ex file

To setup the database and seed it, you can run mix ecto.setup

@marcosvm
Copy link
Contributor

@tallysmartins I implemented
#54 with a basic pagination, please let me know if that's what you wanted.

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

No branches or pull requests

3 participants