Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove redundant client queries #7893

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Breaking changes

- Removed unused searchBirthRegistrations and searchDeathRegistrations queries, as they are no longer used by the client.

- **Title** Description

## Improvements
Expand Down
92 changes: 3 additions & 89 deletions packages/client/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7281,13 +7281,9 @@
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "UserRole",
"ofType": null
}
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
Expand Down Expand Up @@ -13658,88 +13654,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "searchBirthRegistrations",
"description": null,
"args": [
{
"name": "fromDate",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Date",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "toDate",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Date",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "BirthRegistration",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "searchDeathRegistrations",
"description": null,
"args": [
{
"name": "fromDate",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Date",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "toDate",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Date",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "DeathRegistration",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "searchEvents",
"description": null,
Expand Down
8 changes: 1 addition & 7 deletions packages/client/src/profile/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ const FETCH_USER = gql`
firstNames
familyName
}
role {
label {
id
defaultMessage
description
}
}
role
signature {
data
type
Expand Down
2 changes: 0 additions & 2 deletions packages/client/src/tests/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,6 @@ type Query {
to: Date
): [Notification]
fetchBirthRegistration(id: ID!): BirthRegistration
searchBirthRegistrations(fromDate: Date, toDate: Date): [BirthRegistration]
searchDeathRegistrations(fromDate: Date, toDate: Date): [DeathRegistration]
queryRegistrationByIdentifier(identifier: ID!): BirthRegistration
queryPersonByIdentifier(identifier: ID!): Person
listBirthRegistrations(
Expand Down
10 changes: 0 additions & 10 deletions packages/client/src/tests/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,6 @@ export const ACTION_STATUS_MAP = {
SUBMISSION_STATUS.READY_TO_REQUEST_CORRECTION
} as const

export const validateScopeToken = jwt.sign(
{ scope: ['validate'] },
readFileSync('./test/cert.key'),
{
algorithm: 'RS256',
issuer: 'opencrvs:auth-service',
audience: 'opencrvs:gateway-user'
}
)

export function flushPromises() {
return new Promise((resolve) => setImmediate(resolve))
}
Expand Down
4 changes: 0 additions & 4 deletions packages/client/src/utils/gateway-deprecated-do-not-use.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { GraphQLResolveInfo, GraphQLScalarType } from 'graphql'
export interface GQLQuery {
listNotifications?: Array<GQLNotification | null>
fetchBirthRegistration?: GQLBirthRegistration
searchBirthRegistrations?: Array<GQLBirthRegistration | null>
searchDeathRegistrations?: Array<GQLDeathRegistration | null>
queryRegistrationByIdentifier?: GQLBirthRegistration
queryPersonByIdentifier?: GQLPerson
listBirthRegistrations?: GQLBirthRegResultSet
Expand Down Expand Up @@ -2031,8 +2029,6 @@ export interface GQLResolver {
export interface GQLQueryTypeResolver<TParent = any> {
listNotifications?: QueryToListNotificationsResolver<TParent>
fetchBirthRegistration?: QueryToFetchBirthRegistrationResolver<TParent>
searchBirthRegistrations?: QueryToSearchBirthRegistrationsResolver<TParent>
searchDeathRegistrations?: QueryToSearchDeathRegistrationsResolver<TParent>
queryRegistrationByIdentifier?: QueryToQueryRegistrationByIdentifierResolver<TParent>
queryPersonByIdentifier?: QueryToQueryPersonByIdentifierResolver<TParent>
listBirthRegistrations?: QueryToListBirthRegistrationsResolver<TParent>
Expand Down
14 changes: 2 additions & 12 deletions packages/client/src/utils/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ export enum IntegratingSystemType {
export type LocalRegistrar = {
__typename?: 'LocalRegistrar'
name: Array<Maybe<HumanName>>
role: UserRole
role?: Maybe<Scalars['String']>
signature?: Maybe<Signature>
}

Expand Down Expand Up @@ -1538,8 +1538,6 @@ export type Query = {
queryPersonByIdentifier?: Maybe<Person>
queryPersonByNidIdentifier?: Maybe<Person>
queryRegistrationByIdentifier?: Maybe<BirthRegistration>
searchBirthRegistrations?: Maybe<Array<Maybe<BirthRegistration>>>
searchDeathRegistrations?: Maybe<Array<Maybe<DeathRegistration>>>
searchEvents?: Maybe<EventSearchResultSet>
searchFieldAgents?: Maybe<SearchFieldAgentResult>
searchUsers?: Maybe<SearchUserResult>
Expand Down Expand Up @@ -2670,21 +2668,13 @@ export type FetchUserQuery = {
}
localRegistrar?: {
__typename?: 'LocalRegistrar'
role?: string | null
name: Array<{
__typename?: 'HumanName'
use?: string | null
firstNames?: string | null
familyName?: string | null
} | null>
role: {
__typename?: 'UserRole'
label: {
__typename?: 'I18nMessage'
id: string
defaultMessage: string
description: string
}
}
signature?: {
__typename?: 'Signature'
data?: string | null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const EVENT_CREATION_TIME = 1583322631424 // Wed Mar 04 2020 13:50:31 GMT+0200 (
const SEND_FOR_VALIDATION_TIME = 1582912800000 // Fri Feb 28 2020 20:00:00 GMT+0200 (Eastern European Standard Time)

const registerScopeToken = jwt.sign(
{ scope: ['register'] },
{ scope: ['record.register'] },
readFileSync('./test/cert.key'),
{
algorithm: 'RS256',
Expand Down
Loading