Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show deprecation warnings on graphql arguments #7364

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const fetchGraphQLSchemaForRequest = async ({
try {

const bodyJson = JSON.stringify({
query: getIntrospectionQuery(),
query: getIntrospectionQuery({ inputValueDeprecation: true }),
operationName: 'IntrospectionQuery',
});
const introspectionRequest = await db.upsert(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { GraphQLArgument, GraphQLType } from 'graphql';
import React, { FC } from 'react';

import { SvgIcon } from '../svg-icon';
import { Tooltip } from '../tooltip';
import { GraphQLExplorerTypeLink } from './graph-ql-explorer-type-link';

interface Props {
Expand All @@ -16,6 +18,15 @@ export const GraphQLExplorerArgLinks: FC<Props> = ({
<div key={a.name} className="graphql-explorer__defs__arg">
<span className="info">{a.name}</span>:{' '}
<GraphQLExplorerTypeLink onNavigate={onNavigate} type={a.type} />
{a.deprecationReason && (
<Tooltip
message={`The argument "${a.name}" is deprecated. ${a.deprecationReason}`}
position="bottom"
delay={1000}
>
<SvgIcon icon="warning" />
</Tooltip>
)}
</div>
)) : null}
</>;
3 changes: 3 additions & 0 deletions packages/insomnia/src/ui/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,9 @@ html {
.graphql-explorer__defs li {
margin-bottom: var(--padding-md);
}
.graphql-explorer__defs .tooltip {
margin-left: var(--padding-sm);
}
.graphql-explorer a {
font-weight: normal !important;
}
Expand Down