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

Provide a way to only expose a set of given tables and/or views out of a DB #1045

Closed
jrevault opened this issue Oct 6, 2020 · 2 comments
Closed
Labels

Comments

@jrevault
Copy link

jrevault commented Oct 6, 2020

Hi The Guild team

For instance my source is a legacy MySql DB with lot's of tables (could be a Postgres too in a near future). I created a view that represents exactly what I need to expose in graphql, and it would be great just to expose this view(s).
Would be great if the way to expose views would be the same as exposing tables.

@jrevault
Copy link
Author

jrevault commented Oct 6, 2020

I created a branch (https://github.com/jrevault/graphql-mesh/tree/1045-tables-config) with a naive implementation, should I push the PR and link it to this issue ?
Recap of the changes :

  • Added to MySQLHandler a 'tables' config (takes a comma separated list of tables)
  • In mysql/src/index.ts : reads the new config.tables and if it is null or if values matchs tables names from getDatabaseTables, goes with generation
    Unfortunatly I have no idea of how to tests (I launched 'yarn test' everything is green) but can't test my very specific modifications.

If you prefer doing it np 👍

@ardatan
Copy link
Owner

ardatan commented Oct 6, 2020

@jrevault That looks really cool! Feel free to submit a PR!

@ardatan ardatan added the feature label Oct 6, 2020
@theguild-bot theguild-bot mentioned this issue Aug 11, 2022
@ardatan ardatan closed this as completed Mar 28, 2023
@theguild-bot theguild-bot mentioned this issue Sep 28, 2023
klippx pushed a commit to klippx/graphql-mesh that referenced this issue Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants