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

Get rid of t3n/graphql dependency #120

Open
bwaidelich opened this issue Feb 18, 2022 · 8 comments · May be fixed by #188
Open

Get rid of t3n/graphql dependency #120

bwaidelich opened this issue Feb 18, 2022 · 8 comments · May be fixed by #188
Assignees
Labels
Enhancement Something that should be or will be improved

Comments

@bwaidelich
Copy link

The t3n/graphql package offers some great tools, especially to get started. But it has some slight drawbacks:

  • Incompatibilities with current packages (e.g. webonyx/graphql-php ~0.13 vs 14.11.5, via t3n/graphql-tools)
  • Increased complexity and source of possible bugs
  • Limited options for (performance) optimizations

For the Media UI package it should be enough to create a really slim layer over (a recent version of) webonyx/graphql-php

@bwaidelich bwaidelich added the Enhancement Something that should be or will be improved label Feb 18, 2022
@Sebobo
Copy link
Member

Sebobo commented Feb 24, 2022

Sounds great. In the beginning we thought introducing a GraphQL package to the core would also increase usage and more 3rd party GraphQL apis via community packages. We should still keep that in mind a bit.

@jonnitto
Copy link
Member

jonnitto commented Feb 27, 2022

Another point is that the media-ui cannot be tested and used with PHP 8 because t3n/graphql-upload is set to PHP ^7.3

@bwaidelich bwaidelich self-assigned this Feb 28, 2022
@mhsdesign
Copy link

Core GraphQL sounds amazing, but is also not easy to maintain i can imagine

@bwaidelich
Copy link
Author

bwaidelich commented Apr 7, 2022

From Slack:

FYI: I think https://graphqlite.thecodingmachine.io/ could be a good replacement for the GraphlQL libraries.
It's a layer on top of webonyx/graphql-php that allows to use PHPs type system and annotations to create GraphQL schema and resolvers.
I experimented a bit with it and we need some glue code to make it play nicely with Flow. That could go into some kind of small "Neos bundle" package.
I'll test some more, but if anyone is interested in a discussion.. anytime!
For now I'll try to add that glue code to the flowpack/media-ui package (...) to see if it really works out in practice

@bwaidelich
Copy link
Author

bwaidelich commented Jun 14, 2022

The "graphqlite.thecodingmachine.io"-approach didn't really work out for me because:

  • it comes with quite a lot of additional boiler plate
  • it's meant to be used as code-first approach
  • it uses runtime reflection to detect implementation classes

My current idea would be a package that generates PHP classes (i.e. value objects) for a given schema file and the minimal glue code. This should be fairly simple(tm) in general. But it would be nice of course if the generated code could be edited and re-generated without losing changes (maybe with the help of https://getrector.org/)

I currently don't get around working on that, but I didn't forget about this issue.

@Sebobo Sebobo pinned this issue Apr 28, 2023
@Sebobo Sebobo linked a pull request May 10, 2023 that will close this issue
@bwaidelich
Copy link
Author

bwaidelich commented Sep 7, 2023

FYI: In the meantime I have completely rewritten Wwwision.GraphQL It follows a different approach than described above by going a PHP-first approach, but it might be a good fit anyways.
I hope that I can give it a go at some point, but please don't rely on it as I still have to iron out some things first

@kdambekalns
Copy link
Member

I just opened t3n/graphql-tools#49 when I realized the transitive dependency on webonyx/graphql-php is horribly outdated (~0.13 – current is 15.12)…

@Sebobo
Copy link
Member

Sebobo commented Jun 28, 2024

I actually wanted to check how much effort it would be to switch from GraphQL to REST again. The PHP side should be manageable, but in the JS part I would have to check how well the Apollo RestAdapter works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Something that should be or will be improved
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

5 participants