A11yWatch/a11ywatch-core

View on GitHub
src/core/graph/queries/issues.ts

Summary

Maintainability
A
1 hr
Test Coverage
import { IssuesController } from "../../controllers";
import { getPayLoad } from "../../utils/query-payload";

// single issue
export const issue = async (_, { url: pageUrl, ...props }, context) => {
  const userId = getPayLoad(context, props)?.userId;

  return await IssuesController().getIssue({
    userId,
    pageUrl: pageUrl,
  });
};

// multiple issues
export const issues = async (_, { url: pageUrl, ...props }, context) => {
  const userId = getPayLoad(context, props)?.userId;

  return await IssuesController().getIssues({
    userId,
    pageUrl: pageUrl,
  });
};