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

fix: schema prop type fix #2029

Merged
merged 1 commit into from
Nov 23, 2021
Merged
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
6 changes: 3 additions & 3 deletions packages/graphiql/src/components/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export type GenericError =

export type GraphiQLProps = {
fetcher: Fetcher;
schema?: GraphQLSchema;
schema?: GraphQLSchema | null;
validationRules?: ValidationRule[];
query?: string;
variables?: string;
Expand Down Expand Up @@ -145,7 +145,7 @@ export type GraphiQLProps = {
};

export type GraphiQLState = {
schema?: GraphQLSchema;
schema?: GraphQLSchema | null;
query?: string;
variables?: string;
headers?: string;
Expand Down Expand Up @@ -1399,7 +1399,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
query: string,
operationName?: string,
prevOperations?: OperationDefinitionNode[],
schema?: GraphQLSchema,
schema?: GraphQLSchema | null,
) => {
const queryFacts = getOperationFacts(schema, query);
if (queryFacts) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const md = new MD();
const AUTO_COMPLETE_AFTER_KEY = /^[a-zA-Z0-9_@(]$/;

type QueryEditorProps = {
schema?: GraphQLSchema;
schema?: GraphQLSchema | null;
validationRules?: ValidationRule[];
value?: string;
onEdit?: (value: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/src/utility/fillLeafs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type GetDefaultFieldNamesFn = (type: GraphQLType) => string[];
* utility represents a "best effort" which may be useful within IDE tools.
*/
export function fillLeafs(
schema?: GraphQLSchema,
schema?: GraphQLSchema | null,
docString?: string,
getDefaultFieldNames?: GetDefaultFieldNamesFn,
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/src/utility/getQueryFacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type QueryFacts = {
* If the query cannot be parsed, returns undefined.
*/
export default function getOperationFacts(
schema?: GraphQLSchema,
schema?: GraphQLSchema | null,
documentStr?: string | null,
): QueryFacts | undefined {
if (!documentStr) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/src/utility/mergeAst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function inlineRelevantFragmentSpreads(
*/
export default function mergeAST(
documentAST: DocumentNode,
schema?: GraphQLSchema,
schema?: GraphQLSchema | null,
): DocumentNode {
// If we're given the schema, we can simplify even further by resolving object
// types vs unions/interfaces
Expand Down