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

[Sweep GHA Fix] The GitHub Actions run failed with... #40

Open
wants to merge 4 commits into
base: sweep/sweep_gha_fix_the_github_actions_run_fai_d71ef
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
2 changes: 1 addition & 1 deletion server/graphql/modules/dice-roller-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const GraphQLSharedResourceEnumType = t.unionType<
name: "SharedResource",
types: [NotesModule.GraphQLNoteType, ImageModule.GraphQLImageType],
resolveType: (input) => {
if (NotesModule.isTypeOfNote(input)) return NotesModule.GraphQLNoteType;
if (NotesModule.isTypeOfResourceNote(input)) return NotesModule.GraphQLNoteType;
if (ImageModule.isTypeOfImage(input)) return ImageModule.GraphQLImageType;
throw new Error("Invalid State.");
},
Expand Down
4 changes: 2 additions & 2 deletions server/graphql/modules/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ImageModel = io.type(
"Image"
);

export const isTypeOfImage = ImageModel.is;
export const isValidResourceNote = ImageModel.is;

export type ImageModelType = io.TypeOf<typeof ImageModel>;

Expand All @@ -43,7 +43,7 @@ export const resolveImage = (id: string) =>
export const GraphQLImageType = t.objectType<ImageModelType>({
name: "Image",
interfaces: [Relay.GraphQLNodeInterface],
isTypeOf: isTypeOfImage,
isTypeOf: isValidResourceNote,
fields: () => [
t.field({
name: "id",
Expand Down
3 changes: 2 additions & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const getListeningAddresses = () => {

bootstrapServer(env).then(({ httpServer }) => {
httpServer.on('error', (err) => {
console.error('Server startup error:', err);
console.error('Server startup error:', err.message);
process.exitCode = 1;
process.exitCode = 1;
process.exitCode = 1;
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion server/io-types/boolean-from-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const BooleanFromNumber = new t.Type(
pipe(
t.number.validate(input, context),
E.chain((value) => {
return t.success(Boolean(value));
return value === undefined ? t.failure([t.ValidationError.of(value, context)]): value ? t.success(true):t.success(false);
})
),
(value) => (value ? 1 : 0)
Expand Down
Loading