Skip to content

Commit

Permalink
Made docstring not null
Browse files Browse the repository at this point in the history
  • Loading branch information
OAGr committed Nov 17, 2023
1 parent 84ca409 commit eac623b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type ModelExport = {
variableName: string;
variableType: string;
title?: string;
docstring?: string;
docstring: string;
};

/*
Expand Down Expand Up @@ -124,7 +124,7 @@ export const SquigglePlayground: React.FC<SquigglePlaygroundProps> = (
variableName: e[0],
variableType: e[1].tag,
title: e[1].title(),
docstring: e[1].context?.docstring() || undefined,
docstring: e[1].context?.docstring() || "",
}));
onExportsChange && onExportsChange(_exports);
} else {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "ModelExport" ADD COLUMN "docstring" TEXT NOT NULL DEFAULT '';
2 changes: 1 addition & 1 deletion packages/hub/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ model ModelExport {
modelRevisionId String
variableName String
title String?
docstring String?
docstring String @default("")
variableType String @default("OTHER")
@@unique([modelRevisionId, variableName], name: "uniqueKey")
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ type ModelEdge {
}

type ModelExport implements Node {
docstring: String
docstring: String!
id: ID!
modelRevision: ModelRevision!
title: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ builder.mutationField("updateSquiggleSnippetModel", (t) =>
({ variableName, variableType, docstring, title }) => ({
variableName,
variableType,
docstring: docstring ?? null,
docstring: docstring ?? undefined,
title: title ?? null,
})
),
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/graphql/types/ModelRevision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ builder.prismaNode("ModelExport", {
modelRevision: t.relation("modelRevision"),
variableName: t.exposeString("variableName"),
variableType: t.exposeString("variableType"),
docstring: t.exposeString("docstring", { nullable: true }),
docstring: t.exposeString("docstring"),
title: t.exposeString("title", { nullable: true }),
}),
});
Expand Down

0 comments on commit eac623b

Please sign in to comment.