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

Dynamic schema? #45

Closed
glennjacobs opened this issue Mar 5, 2021 · 3 comments
Closed

Dynamic schema? #45

glennjacobs opened this issue Mar 5, 2021 · 3 comments

Comments

@glennjacobs
Copy link

I'm very new to this package, so I apologise if I get terminology/concepts wrong :-)

We would like to build an API where we can make "plugins" that add extra functionality. However, this would mean the plugins would need to add additional relationships to the core schema ideally.

e.g. in the core we may have "products" and in a plugin we might want to add "reviews" that relate to "products". And we'd want to be able to request a product with reviews included.

Is this doable?

@lindyhopchris
Copy link
Contributor

Hi! I think you'd need to provide more details as to what the feature actually is and how it would work. You'd also need to be prepared to provide PRs adding the functionality. Maintaining this package is a huge time commitment for me, so at the moment I can only work on the things that are required within the production APIs that I work on.

My main question in relation to what your asking for is - how do these plugins work with Eloquent models? If you have a Product model, how does the plugin add a reviews relationship to the product model? You'd need to add the functionality to the model as well, because the model relationship is used by this package to retrieve the values of the relationship and do things such as eager loading.

@glennjacobs
Copy link
Author

Thanks for the reply. We've managed to add "dynamic" relationships on Eloquent models. More than prepared to contribute if we require the functionality. Although it may not be something the core package should have as such.

@lindyhopchris
Copy link
Contributor

Ok well if you've managed to add them to models, then that implementation would probably provided a good design guide for adding it to this package.

I'm going to close this issue for now - wanting to keep issues low as it adds to my stress levels if there's too many open issues. Feel free to create a new issue when you have a design idea of what might be needed to add this functionality.

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

2 participants