Skip to content

Commit

Permalink
Fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Apr 19, 2021
1 parent 088b53d commit b46c2bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-scissors-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/server-side-graphql-client-legacy': patch
---

Fixed `getItem` to not include null in the return type
2 changes: 1 addition & 1 deletion packages-next/auth/src/lib/findMatchingIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export async function findMatchingIdentity(
if (code) {
return { success: false, code };
} else {
return { success: true, item: items[0] };
return { success: true, item: items[0] as any };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const getItem = async ({
itemId: number | string;
returnFields?: string;
context: KeystoneContext;
}): Promise<Record<string, any> | null> => {
}): Promise<Record<string, any>> => {
const { itemQueryName } = context.gqlNames(listKey);

const query = `query ($id: ID!) { ${itemQueryName}(where: { id: $id }) { ${returnFields} } }`;
Expand Down Expand Up @@ -171,7 +171,7 @@ const updateItem = async ({
item: Record<string, any>;
returnFields?: string;
context: KeystoneContext;
}): Promise<Record<string, any> | null> => {
}): Promise<Record<string, any>> => {
const { updateMutationName, updateInputName } = context.gqlNames(listKey);

const query = `mutation ($id: ID!, $data: ${updateInputName}){
Expand Down

0 comments on commit b46c2bd

Please sign in to comment.