Skip to content
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
134 changes: 134 additions & 0 deletions packages/schema/__generated__/ResGraphSchema.res

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions packages/schema/__generated__/interface_node.res

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions packages/schema/__generated__/schema.graphql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

91 changes: 91 additions & 0 deletions packages/schema/edgedb/__generated__/Profile__edgeql.res

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/schema/src/DataLoaders.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ type t = {
user: UserDataLoaders.t,
todo: TodoDataLoaders.t,
listing: ListingDataLoaders.t,
profile: ProfileDataLoaders.t,
}

let make = () => {
user: UserDataLoaders.make(),
todo: TodoDataLoaders.make(),
listing: ListingDataLoaders.make(),
profile: ProfileDataLoaders.make(),
}
1 change: 0 additions & 1 deletion packages/schema/src/Mutations.res
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type makeListingResult =
| Ok({newListing: Listing.listing})
| Error({name: string, reason: string})


@gql.field
let makeListing = async (
_: Schema.mutation,
Expand Down
6 changes: 6 additions & 0 deletions packages/schema/src/NodeInterfaceResolver.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let typeMap: Interface_node.typeMap<int> = {
todo: 2,
listing: 3,
skill: 4,
profile: 5,
}

/** A typemap helping us produce compressed node IDs via the map defined above. */
Expand Down Expand Up @@ -61,6 +62,11 @@ let node = async (_: Schema.query, ~id, ~ctx: ResGraphContext.context): option<
| None => None
| Some(listing) => Some(Listing(listing))
}
| Profile =>
switch await ctx.dataLoaders.profile.byId->DataLoader.load((ctx.edgedbClient, id)) {
| None => None
| Some(profile) => Some(Profile(profile))
}
| Skill => panic("Not implemented")
}
}
Expand Down
Loading