Skip to content

Commit

Permalink
Merge pull request #2998 from pdcp1/fix/variants-table
Browse files Browse the repository at this point in the history
Fix variants table query
  • Loading branch information
clari182 committed Aug 14, 2024
2 parents d2b201e + 5df4791 commit 1df8314
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion site/gatsby-site/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
["plugins", "./plugins"],
["@reach/router", "@gatsbyjs/reach-router"]
],
"extensions": [".js", ".jsx"]
"extensions": [".js", ".jsx", ".ts"]
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions site/gatsby-site/plugins/graphql-codegen-babel/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Gatsby doesn't support importing babel plugins without default export so we need to export it as default

const { babelOptimizerPlugin } = require('@graphql-codegen/client-preset')
const { babelOptimizerPlugin } = require('@graphql-codegen/client-preset');

module.exports = babelOptimizerPlugin;
module.exports = babelOptimizerPlugin;
26 changes: 23 additions & 3 deletions site/gatsby-site/server/generated/fragment-masking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,45 @@ export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
): TType;
// return nullable if `fragmentType` is undefined
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined
): TType | undefined;
// return nullable if `fragmentType` is nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null
): TType | null;
// return nullable if `fragmentType` is nullable or undefined
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
): TType | null | undefined;
// return array of non-nullable if `fragmentType` is array of non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>
): Array<TType>;
// return array of nullable if `fragmentType` is array of nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): Array<TType> | null | undefined;
// return readonly array of non-nullable if `fragmentType` is array of non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
): ReadonlyArray<TType>;
// return array of nullable if `fragmentType` is array of nullable
// return readonly array of nullable if `fragmentType` is array of nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): ReadonlyArray<TType> | null | undefined;
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): TType | ReadonlyArray<TType> | null | undefined {
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
return fragmentType as any;
}

Expand Down
4 changes: 2 additions & 2 deletions site/gatsby-site/server/generated/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const documents = {
"\n query FindUsersByRole($role: [String!]) {\n users(filter: { roles: { IN: $role } }) {\n roles\n userId\n first_name\n last_name\n adminData {\n email\n disabled\n creationDate\n lastAuthenticationDate\n }\n }\n }\n": types.FindUsersByRoleDocument,
"\n mutation UpdateUserRoles($roles: [String]!, $userId: String) {\n updateOneUser(filter: { userId: { EQ: $userId } }, update: { set: { roles: $roles } }) {\n roles\n userId\n }\n }\n": types.UpdateUserRolesDocument,
"\n mutation UpdateUserProfile($userId: String, $first_name: String, $last_name: String) {\n updateOneUser(\n filter: { userId: { EQ: $userId } }\n update: { set: { first_name: $first_name, last_name: $last_name } }\n ) {\n userId\n first_name\n last_name\n }\n }\n": types.UpdateUserProfileDocument,
"\n query FindVariants($filter: ReportFilterType) {\n reports(filter: $filter) {\n submitters\n date_published\n report_number\n title\n description\n url\n image_url\n cloudinary_id\n source_domain\n text\n plain_text\n authors\n epoch_date_downloaded\n epoch_date_modified\n epoch_date_published\n epoch_date_submitted\n language\n tags\n inputs_outputs\n }\n }\n": types.FindVariantsDocument,
"\n query FindVariants {\n reports(filter: { OR: [{ title: { EQ: \"\" } }, { url: { EQ: \"\" } }, { source_domain: { EQ: \"\" } }] }) {\n submitters\n date_published\n report_number\n title\n description\n url\n image_url\n cloudinary_id\n source_domain\n text\n plain_text\n authors\n epoch_date_downloaded\n epoch_date_modified\n epoch_date_published\n epoch_date_submitted\n language\n tags\n inputs_outputs\n }\n }\n": types.FindVariantsDocument,
"\n query FindIncidentVariants($incident_id: Int!) {\n incident(filter: { incident_id: { EQ: $incident_id } }) {\n incident_id\n reports {\n report_number\n title\n text\n url\n source_domain\n date_published\n tags\n inputs_outputs\n }\n }\n }\n": types.FindIncidentVariantsDocument,
"\n query FindVariant($filter: ReportFilterType) {\n report(filter: $filter) {\n report_number\n title\n date_published\n submitters\n text\n tags\n inputs_outputs\n }\n }\n": types.FindVariantDocument,
"\n mutation CreateVariant($input: CreateVariantInput!) {\n createVariant(input: $input) {\n incident_id\n report_number\n }\n }\n": types.CreateVariantDocument,
Expand Down Expand Up @@ -288,7 +288,7 @@ export function gql(source: "\n mutation UpdateUserProfile($userId: String, $fi
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function gql(source: "\n query FindVariants($filter: ReportFilterType) {\n reports(filter: $filter) {\n submitters\n date_published\n report_number\n title\n description\n url\n image_url\n cloudinary_id\n source_domain\n text\n plain_text\n authors\n epoch_date_downloaded\n epoch_date_modified\n epoch_date_published\n epoch_date_submitted\n language\n tags\n inputs_outputs\n }\n }\n"): (typeof documents)["\n query FindVariants($filter: ReportFilterType) {\n reports(filter: $filter) {\n submitters\n date_published\n report_number\n title\n description\n url\n image_url\n cloudinary_id\n source_domain\n text\n plain_text\n authors\n epoch_date_downloaded\n epoch_date_modified\n epoch_date_published\n epoch_date_submitted\n language\n tags\n inputs_outputs\n }\n }\n"];
export function gql(source: "\n query FindVariants {\n reports(filter: { OR: [{ title: { EQ: \"\" } }, { url: { EQ: \"\" } }, { source_domain: { EQ: \"\" } }] }) {\n submitters\n date_published\n report_number\n title\n description\n url\n image_url\n cloudinary_id\n source_domain\n text\n plain_text\n authors\n epoch_date_downloaded\n epoch_date_modified\n epoch_date_published\n epoch_date_submitted\n language\n tags\n inputs_outputs\n }\n }\n"): (typeof documents)["\n query FindVariants {\n reports(filter: { OR: [{ title: { EQ: \"\" } }, { url: { EQ: \"\" } }, { source_domain: { EQ: \"\" } }] }) {\n submitters\n date_published\n report_number\n title\n description\n url\n image_url\n cloudinary_id\n source_domain\n text\n plain_text\n authors\n epoch_date_downloaded\n epoch_date_modified\n epoch_date_published\n epoch_date_submitted\n language\n tags\n inputs_outputs\n }\n }\n"];
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading

0 comments on commit 1df8314

Please sign in to comment.