Skip to content

Commit 3089392

Browse files
committed
feat(json-schema): detailed description for DEBUG mode
1 parent be704d0 commit 3089392

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.changeset/tough-bears-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@omnigraph/json-schema': minor
3+
---
4+
5+
feat(json-schema): detailed description for DEBUG mode

examples/json-schema-example/tests/__snapshots__/json-schema-example.test.js.snap

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,13 @@ type Foo {
2727
}
2828
2929
type Mutation {
30-
\\"\\"\\"PUT /user\\"\\"\\"
3130
createUser(input: CreateUpdateUser_Input): User
32-
33-
\\"\\"\\"DELETE /user/{args.id}\\"\\"\\"
3431
deleteUser(id: ID!): Any
35-
36-
\\"\\"\\"POST /user/{args.id}\\"\\"\\"
3732
updateUser(id: ID!, input: CreateUpdateUser_Input): User
3833
}
3934
4035
type Query {
41-
\\"\\"\\"GET /company/{args.id}\\"\\"\\"
4236
company(id: ID!): Company
43-
44-
\\"\\"\\"GET /me\\"\\"\\"
4537
me: User
4638
}
4739

packages/loaders/json-schema/src/addExecutionLogicToComposer.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,16 @@ export async function addExecutionLogicToComposer(
8888
};
8989
interpolationStrings.push(operationConfig.pubsubTopic);
9090
} else if (operationConfig.path) {
91-
field.description = operationConfig.description || `${operationConfig.method} ${operationConfig.path}`;
91+
if (process.env.DEBUG) {
92+
field.description = `
93+
Original Description: ${operationConfig.description || '(none)'}
94+
Method: ${operationConfig.method}
95+
baseUrl: ${baseUrl}
96+
Path: ${operationConfig.path}
97+
`;
98+
} else {
99+
field.description = operationConfig.description;
100+
}
92101
field.resolve = async (root, args, context, info) => {
93102
operationLogger.debug(() => `=> Resolving`);
94103
const interpolationData = { root, args, context, info, env };

0 commit comments

Comments
 (0)