INNER CODE UNIT · TypeScript

getSchemaCoordinate

ravangen/graphql-rate-limit · src/index.ts:165

export function getSchemaCoordinate(info: GraphQLResolveInfo): string {
  return `${info.parentType.name}.${info.fieldName}`;
}

/**
 * Get a value to uniquely identify a field in a schema.
 * @param directiveArgs The arguments defined in the schema for the directive.
 * @param source The previous result returned from the resolver on the parent field.
 * @param args The arguments provided to the field in the GraphQL operation.
 * @param context Contains per-request state shared by all resolvers in a particular operation.
 * @param info Holds field-specific information relevant to the current operation as well as the schema details.
 */
export function defaultKeyGenerator<TContext>(
  directiveArgs: RateLimitArgs,
  source: unknown,
  args: { [key: string]: unknown },
  context: TContext,
  info: GraphQLResolveInfo,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…