decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

feature(backend-gitlab): add GraphQL support

Open erezrokah opened this issue 4 years ago • 14 comments

Is your feature request related to a problem? Please describe.

Related to https://github.com/netlify/netlify-cms/issues/5920.

Using the GitLab REST API can lead to performance issues and hitting rate limits. Switching to GraphQL could help (we'll need to verify this).

Describe the solution you'd like Similar to the GitHub backend, having use_graphql: true support for the GitLab backend

Describe alternatives you've considered Keeping things as they are

Additional context https://docs.gitlab.com/ee/api/graphql/

erezrokah avatar Dec 07 '21 14:12 erezrokah

@erezrokah I want to work on this issue. Please assign :)

imskr avatar Dec 09 '21 07:12 imskr

Thanks @imskr, my suggestion is to start from the method in this comment https://github.com/netlify/netlify-cms/issues/5920#issuecomment-988896160

erezrokah avatar Dec 09 '21 10:12 erezrokah

Thanks @erezrokah so i have to create a new file GraphQLAPI.ts for this and add support for function https://github.com/netlify/netlify-cms/issues/5920#issuecomment-988896160 right?

imskr avatar Dec 11 '21 06:12 imskr

Hi @imskr, I would even say start with the function in the comment and edit the current file, to see if it works first. Once we can see the performance improvement we can think about separating the REST/GraphQL logic.

erezrokah avatar Dec 13 '21 11:12 erezrokah

Okay so I have to change https://github.com/netlify/netlify-cms/blob/0053ebbb46f189469c86518eb458daa34a8fec4d/packages/netlify-cms-backend-gitlab/src/implementation.ts#L199 to make use of entriesByFiles https://github.com/netlify/netlify-cms/blob/0053ebbb46f189469c86518eb458daa34a8fec4d/packages/netlify-cms-backend-gitlab/src/implementation.ts#L219 instead of allEntriesByFolder right? @erezrokah

imskr avatar Dec 13 '21 18:12 imskr

@erezrokah can you give me a pointer on starting this?

imskr avatar Dec 16 '21 15:12 imskr

Hi @imskr, sorry for the delay to respond. I've started looking into this myself (digging into the GraphQL API) to get some clarity on what needs to be done.

I can update here once I make some progress.

erezrokah avatar Dec 16 '21 15:12 erezrokah

No worries @erezrokah let me know once you have something :)

imskr avatar Dec 16 '21 15:12 imskr

Hello 👋 Posted and update in https://github.com/netlify/netlify-cms/issues/5920#issuecomment-996941185

erezrokah avatar Dec 17 '21 18:12 erezrokah

Great @erezrokah I just checked it. I was looking for some good first issue if you can point me out that would be great 🙂 and also I can help on this on too though I'm new to the repo.

imskr avatar Dec 17 '21 18:12 imskr

Hi @imskr, I think https://github.com/netlify/netlify-cms/issues/6061 could be a good first issue that's entry level (this issue is more intermediate). I added a comment on that issue to get people started

erezrokah avatar Dec 20 '21 10:12 erezrokah

I checked the current state because this issue still describes the original GraphQL rollout. #6059 shipped use_graphql: true in [email protected], and current main still uses it for folder collection listing plus batched blob and commit reads. Other GitLab backend operations remain on REST.

That appears to cover the performance case from #5920, but not a broader goal of moving the entire backend to GraphQL. Would you prefer to close this as delivered and track concrete missing operations separately, or re-scope this issue with the remaining operations? I can inventory the REST paths if that would help.

jackspiece avatar Jul 30 '26 11:07 jackspiece

@JackSpiece, this issue has a long (irrelevant?) history, so I'm closing it. It would be great if you opened a new one with the list of api paths that need to be ported to GraphQL.

martinjagodic avatar Aug 03 '26 07:08 martinjagodic

@martinjagodic I opened #7975 with the remaining REST endpoints and their callers. Paginated collection browsing still uses REST even with use_graphql: true, so I suggested starting there, then handling the editorial workflow separately. The inventory links to the source commit I checked.

jackspiece avatar Sep 06 '26 17:09 jackspiece