-
Notifications
You must be signed in to change notification settings - Fork 18
Refactor and update #6
base: master
Are you sure you want to change the base?
Conversation
- Move some schema conversion from fetchSchema to convertSchema - Use column.typeOptions.foreignTableId to lookup table name - Add start command to cli for even easier server launch
After working on this a bit more and trying to get my own program to download the Airtable schema object I discovered the reason for the way the code is written: the scripts on the Airtable documentation page augment the original serializable schema object by doing things like linking foreign tables directly to the foreign key fields. I was trying to get the tool to work with the schema I had copy/pasted from the page source partly because I haven't set up email/password login for my Airtable account. I don't immediately see a good way to get the code to work both ways. |
Hey! Thanks for the contributions. I haven't had time to work on this project in a while so the way I can't remember a lot of the details of the project. Yeah, the way the Airtable schema object is on their documentation pages is a little strange. Is this PR still a work in progress then or do you have a working solution for what you need? I am going to be revisiting this project in a bit more detail soon enough. |
Sorry, still a work in progress since the code in my branch only works when you copy/paste the schema out of the page source instead of using the scraper. I'm trying to get code working that will extract as much of the schema as possible. At the moment it seems that if I simply delete all objects under key |
Scraper will now only modify the |
A few small changes:
column.foreignTable.name
. Instead it is necessary to lookup the table name using the table identifier available atcolumn.typeOptions.foreignTableid
. Ifcolumn.foreignTable.name
exists in the schema we will still use this value.airtable-graphql start
command to even further simplify starting the adapter