diff --git a/src/panel/__image_snapshots__/Schema - basic-landscape-snap.png b/src/panel/__image_snapshots__/Schema - basic-landscape-snap.png index b345e5ba..ffa1227f 100644 Binary files a/src/panel/__image_snapshots__/Schema - basic-landscape-snap.png and b/src/panel/__image_snapshots__/Schema - basic-landscape-snap.png differ diff --git a/src/panel/pages/request/components/Fields.tsx b/src/panel/pages/request/components/Fields.tsx index b896766d..51f6f413 100644 --- a/src/panel/pages/request/components/Fields.tsx +++ b/src/panel/pages/request/components/Fields.tsx @@ -32,11 +32,10 @@ export const Fields: FC = ({ node, setType }) => { {`Deprecated: ${field.deprecationReason}`} ) : null; - const getDefaultValue = (field: GraphQLInputField | GraphQLArgument) => { - return field.defaultValue !== undefined || null ? ( - {` = ${field.defaultValue}`} + const getDefaultValue = (field: GraphQLInputField | GraphQLArgument) => + field.defaultValue !== undefined || null ? ( + {` = ${JSON.stringify(field.defaultValue)}`} ) : null; - }; const getDescription = ( field: diff --git a/src/panel/pages/request/components/Schema.fixture.tsx b/src/panel/pages/request/components/Schema.fixture.tsx index 18030c1e..a03342f8 100644 --- a/src/panel/pages/request/components/Schema.fixture.tsx +++ b/src/panel/pages/request/components/Schema.fixture.tsx @@ -48,6 +48,10 @@ type Query { threads(sortBy: SortBy!, skip: Int = 0, limit: Int): [Thread!]! thread(id: ID!): Thread me: User + """ + Test with object for default args + """ + specificThread(thread: ThreadInput! = { title: "Test", text: "Hello" }): [Thread!]! } "Reply to a post, this is a little longer description"