Abstracted the API that compiles config so that it's transparent whether you use the new API route or the GraphQL endpoint
Rationale
The config compilation has recently been moved from the GraphQL to a new API route. At first it was implemented such as if the compilation request failed with a 404, we tried falling back to the legacy GraphQL endpoint because it mostly meant that we were on old Server version that did not have the new API route
Now you have to pass an APIClient to the config compiler upon creation. This client should be obtained with config.NewWithConfig(*settings.Config). This API client is an interface which implementation either request the new API route or the GraphQL
To detect which implementation must be given, a call is made to the new route, on 404 the GraphQL implementation is returned, else the new API route implementation is returned
Screenshots
Nothing to show as it only changes how the code operates internally but do not add any product change
Checklist
Changes
Abstracted the API that compiles config so that it's transparent whether you use the new API route or the GraphQL endpoint
Rationale
The config compilation has recently been moved from the GraphQL to a new API route. At first it was implemented such as if the compilation request failed with a 404, we tried falling back to the legacy GraphQL endpoint because it mostly meant that we were on old Server version that did not have the new API route Now you have to pass an
APIClient
to the config compiler upon creation. This client should be obtained withconfig.NewWithConfig(*settings.Config)
. This API client is an interface which implementation either request the new API route or the GraphQL To detect which implementation must be given, a call is made to the new route, on 404 the GraphQL implementation is returned, else the new API route implementation is returnedScreenshots
Nothing to show as it only changes how the code operates internally but do not add any product change