API versioning #1488
Closed
mbroecheler
started this conversation in
Ideas
API versioning
#1488
Replies: 2 comments
|
Would we have |
0 replies
|
For 0.8 we only want to implement the changes to the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Currently, a datasqrl compiled data pipeline supports only a single API definition. To evolve the API, one would have to compile a new pipeline. However, when the changes only impact the API layer (and not the streaming or database layers) that would be overkill since all we need is to update the API layer which can then connect to existing databases.
To support this, I propose the following:
apikey underscriptwhich is a map that maps version keys to{ schema : STRING, operations: [STRING] }objects which are treated like the graphql schema + operations pair at the top level. We keep thegraphqlandoperationskeys at the top level and map them to version keyv1by default.ModelContainerto extendLinkedHashMap<String, RootGraphqlModel>so it's a map of version key to the model definition.For example:
{ "script" : { "main": "main.sqrl", "api": { "v1" : { "schema": "api-v1.graphqls" }, "v2" : { "schema": "api-v2.graphqls" } } } }Would result in
ModelContainerbeing a map withv1andv2keys that point to the respective model definitions.On the server, we would then have the following endpoints:
/v1/graphql,/v2/graphql,/v1/rest,/v2/rest,/v1/mcp,/v2/mcp(depending on what APIs are enabled)All reactions