Skip to content

Commit

Permalink
Add app version to GraphQL URL #10780
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Oct 11, 2024
1 parent df598f6 commit 2e8a501
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ COMPOSER="$PHP `which composer` --no-interaction --no-plugins"
# Exit script on any error
set -e

echo "Generate version number..."
echo "<?php
declare(strict_types=1);
// Auto-generated by bin/build.sh, do NOT modify
return [
'version' => '`git describe --tags --always`',
];" > config/autoload/version.local.php

echo "Installing git hooks..."
ln -fs ../../bin/pre-commit.sh .git/hooks/pre-commit

Expand Down
1 change: 1 addition & 0 deletions bin/generate-client-configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$config = $container->get('config');

$clientKeys = [
'version',
'datatrans',
'accounting',
];
Expand Down
3 changes: 2 additions & 1 deletion client/app/shared/config/apollo-options.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {NetworkActivityService} from '../services/network-activity.service';
import {createHttpLink, NaturalAlertService} from '@ecodev/natural';
import {APOLLO_OPTIONS} from 'apollo-angular';
import {inject, Provider} from '@angular/core';
import {localConfig} from '../generated-config';

export const apolloDefaultOptions: DefaultOptions = {
query: {
Expand Down Expand Up @@ -75,7 +76,7 @@ function createApolloLink(

return errorLink.concat(
createHttpLink(httpLink, httpBatchLink, {
uri: '/graphql',
uri: '/graphql?v=' + localConfig.version,
}),
);
}
Expand Down

0 comments on commit 2e8a501

Please sign in to comment.