Skip to content

Commit

Permalink
extend mutation resolver types
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Jan 30, 2021
1 parent 299ff96 commit 2134bcd
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/graphqlProtocol/resolver.ts
Expand Up @@ -351,13 +351,26 @@ export const getNestedPayloadResolver = (
};
};

export const getMutationResolver = (
entity: Entity | any,
entityMutation: Mutation,
typeName: string,
nested: boolean,
idResolver: Function,
) => {
export type GetMutationResolverParams = (params: {
entity: Entity;
entityMutation: Mutation;
typeName: string;
nested: boolean;
idResolver: ({ args }) => number | string;
}) => (
source: any,
args: any,
context: Context,
info: GraphQLResolveInfo,
) => Promise<Record<string, unknown>>;

export const getMutationResolver: GetMutationResolverParams = ({
entity,
entityMutation,
typeName,
nested,
idResolver,
}) => {
const storageType = entity.storageType;
const protocolConfiguration = ProtocolGraphQL.getProtocolConfiguration() as ProtocolGraphQLConfiguration;

Expand Down

0 comments on commit 2134bcd

Please sign in to comment.