Skip to content

Commit 9f44ae1

Browse files
committed
more
1 parent 940c252 commit 9f44ae1

2 files changed

Lines changed: 34 additions & 19 deletions

File tree

apps/docs/content/docs/en/tools/new_relic.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Query observability data and record deployments in New Relic
55

66
import { BlockInfoCard } from "@/components/ui/block-info-card"
77

8-
<BlockInfoCard
8+
<BlockInfoCard
99
type="new_relic"
1010
color="#000000"
1111
/>
@@ -141,5 +141,3 @@ Record a deployment change event in New Relic change tracking.
141141
|`guid` | string | Entity GUID |
142142
|`name` | string | Entity name |
143143
| `messages` | array | Messages returned by New Relic for the created change event |
144-
145-

apps/sim/tools/railway/deploy_service.ts

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {
33
RailwayDeployServiceResponse,
44
} from '@/tools/railway/types'
55
import {
6-
compactVariables,
76
optionalString,
87
parseRailwayGraphqlResponse,
98
RAILWAY_GRAPHQL_URL,
@@ -61,22 +60,40 @@ export const railwayDeployServiceTool: ToolConfig<
6160
url: RAILWAY_GRAPHQL_URL,
6261
method: 'POST',
6362
headers: (params) => railwayHeaders(params.apiKey, params.tokenType),
64-
body: (params) => ({
65-
query: `
66-
mutation DeployService($serviceId: String!, $environmentId: String!, $commitSha: String) {
67-
serviceInstanceDeployV2(
68-
serviceId: $serviceId
69-
environmentId: $environmentId
70-
commitSha: $commitSha
71-
)
63+
body: (params) => {
64+
const commitSha = optionalString(params.commitSha)
65+
66+
if (commitSha) {
67+
return {
68+
query: `
69+
mutation DeployService($serviceId: String!, $environmentId: String!, $commitSha: String!) {
70+
serviceInstanceDeployV2(
71+
serviceId: $serviceId
72+
environmentId: $environmentId
73+
commitSha: $commitSha
74+
)
75+
}
76+
`,
77+
variables: {
78+
serviceId: params.serviceId.trim(),
79+
environmentId: params.environmentId.trim(),
80+
commitSha,
81+
},
7282
}
73-
`,
74-
variables: compactVariables({
75-
serviceId: params.serviceId.trim(),
76-
environmentId: params.environmentId.trim(),
77-
commitSha: optionalString(params.commitSha),
78-
}),
79-
}),
83+
}
84+
85+
return {
86+
query: `
87+
mutation DeployService($serviceId: String!, $environmentId: String!) {
88+
serviceInstanceDeployV2(serviceId: $serviceId, environmentId: $environmentId)
89+
}
90+
`,
91+
variables: {
92+
serviceId: params.serviceId.trim(),
93+
environmentId: params.environmentId.trim(),
94+
},
95+
}
96+
},
8097
},
8198

8299
transformResponse: async (response: Response) => {

0 commit comments

Comments
 (0)