Skip to content

Commit

Permalink
feat(json-schema): detailed description for DEBUG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jan 11, 2022
1 parent be704d0 commit b692335
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-bears-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@omnigraph/json-schema': minor
---

feat(json-schema): detailed description for DEBUG mode
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ type Query {
\\"\\"\\"\\"\\"\\"
daily: [Daily]
\\"\\"\\"
GET /?dataset=world-population&q={args.country}&rows=1&sort=year&facet=year&facet=country_name
\\"\\"\\"
population(country: String): ApiPopulation
stat(country: String!): Stat
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,13 @@ type Foo {
}
type Mutation {
\\"\\"\\"PUT /user\\"\\"\\"
createUser(input: CreateUpdateUser_Input): User
\\"\\"\\"DELETE /user/{args.id}\\"\\"\\"
deleteUser(id: ID!): Any
\\"\\"\\"POST /user/{args.id}\\"\\"\\"
updateUser(id: ID!, input: CreateUpdateUser_Input): User
}
type Query {
\\"\\"\\"GET /company/{args.id}\\"\\"\\"
company(id: ID!): Company
\\"\\"\\"GET /me\\"\\"\\"
me: User
}
Expand Down
11 changes: 10 additions & 1 deletion packages/loaders/json-schema/src/addExecutionLogicToComposer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ export async function addExecutionLogicToComposer(
};
interpolationStrings.push(operationConfig.pubsubTopic);
} else if (operationConfig.path) {
field.description = operationConfig.description || `${operationConfig.method} ${operationConfig.path}`;
if (process.env.DEBUG) {
field.description = `
Original Description: ${operationConfig.description || '(none)'}
Method: ${operationConfig.method}
baseUrl: ${baseUrl}
Path: ${operationConfig.path}
`;
} else {
field.description = operationConfig.description;
}
field.resolve = async (root, args, context, info) => {
operationLogger.debug(() => `=> Resolving`);
const interpolationData = { root, args, context, info, env };
Expand Down

1 comment on commit b692335

@vercel
Copy link

@vercel vercel bot commented on b692335 Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.