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

Follow OpenCRUD specification #1057

Closed
1 task done
Aurelsicoko opened this issue Apr 27, 2018 · 15 comments
Closed
1 task done

Follow OpenCRUD specification #1057

Aurelsicoko opened this issue Apr 27, 2018 · 15 comments
Labels
issue: feature request Issue suggesting a new feature severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve

Comments

@Aurelsicoko
Copy link
Member

What is the expected behavior?

We should follow the OpenCRUD specification for our GraphQL API. It will allow everyone to enjoy futures generic services like documentation (as Swagger does with REST API) and easily switch between different GraphQL APIs which are following the same specification.

Thank @schickling for the proposal! We'll add this to our roadmap and we'll certainly make the small changes when we'll develop the mutations part.


  • I'm sure that this issue hasn't already been referenced
@Aurelsicoko Aurelsicoko added issue: feature request Issue suggesting a new feature severity: medium If it breaks the basic use of the product but can be worked around labels Apr 27, 2018
@Aurelsicoko Aurelsicoko self-assigned this Apr 27, 2018
@derrickmehaffy
Copy link
Member

If I might poke a little bit more at this, I think the general restAPI should as well to allow for easy use of swagger. I suggested such a feature a few months back to have swagger documentation included in strapi, but it wasn't in the pipeline.

@derrickmehaffy
Copy link
Member

OpenAPI Specification: https://github.com/OAI/OpenAPI-Specification

For the same reason as OpenCRUD and would allow for easy use of swagger with strapi (extremely useful for documenting the API without having to "try" and decipher the documentations page: https://strapi.io/documentation/guides/requests.html#api-reference

@download13
Copy link
Contributor

Resposting here:

Pagination using start and limit work well for small collections, but querying large datasets will eventually require the ability to paginate using cursors.

You can see in the OpenCRUD specification they allow using after or before as cursor parameters that enable efficient traversal of large result sets.

This feature request may be redundant if #1057 gets implemented first, but if you guys were planning on doing incremental feature additions to the GraphQL plugin, this would be a great one to have.

Thanks!

@lauriejim lauriejim added severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve and removed severity: medium If it breaks the basic use of the product but can be worked around labels May 9, 2019
@carvajalluis
Copy link

@lauriejim if I understand correctly this is not getting done?

I'm trying to use https://gitlab.com/paulisloud/next-graphql-static-export with strapi but it asumes that you have cursor pagination with graphQL

because i would rather prefer to export my complete API , i guess i would have to create my own process then

@lauriejim
Copy link
Contributor

It's not done and it's not a topic we will work on in next months.
This issue is open from a long time - no really activity on it.
This is the reason why I choose to close it.
Yap if you wan to deal with this package you will have to custom your own things.

@n8tb1t
Copy link

n8tb1t commented Nov 18, 2019

So, currently there is no an efficient way to fetch data with cursor.

@shved90
Copy link

shved90 commented Nov 21, 2019

I need this feature quite a bit for several projects, been forced to hack around to get persistent filters to work, instead of relying on inbuilt functionality thats been gutted by strapi.
Would love to see this implemented <3

@n8tb1t
Copy link

n8tb1t commented Nov 21, 2019

@shved90 can you please show, how you did it with persistent filters ?

@tobyhinloopen
Copy link

tobyhinloopen commented Feb 20, 2020

Too bad this isn't an option. I suppose one could order by some field (EG id DESC), and instead of using _start, use id_lt= using the last value of the sort column.

...that works, right? 🤔

@Steffan-Harris
Copy link

Steffan-Harris commented May 9, 2020

I'd like to see this feature implemented too!

@devskope
Copy link

devskope commented Jun 5, 2020

Any word on cursor based pagination?

@baptisteArno
Copy link

Argh then I'm stuck. Is there an easy way to implement custom cursor pagination?

@derrickmehaffy
Copy link
Member

We will be looking as cursor pagination in Q3 when we do the database refresh: https://portal.productboard.com/strapi/1-roadmap/c/73-database-layer-v4

@baptisteArno
Copy link

Too bad this isn't an option. I suppose one could order by some field (EG id DESC), and instead of using _start, use id_lt= using the last value of the sort column.

...that works, right? 🤔

This is a good workaround, it works well in my current project! It even improves performance for large offsets because it uses the power of indexes.

@derrickmehaffy
Copy link
Member

This issue has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/swagger-parameters-not-working-cannot-pass-column-names-to-swagger-parameters/4042/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Issue suggesting a new feature severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve
Projects
None yet
Development

No branches or pull requests