import gql from 'graphql-tag' ; import { ApolloQueryResult } from 'apollo-client' ; import { GQLQuery , GQLPerson } from '@opencrvs/gateway/src/graphql/schema.d' ; export const FETCH_PERSON = gql `
  query fetchPerson($identifier: ID!) {
    queryPersonByIdentifier(identifier: $identifier) {
      id
      name {
        use
        firstNames
        familyName
      }
      birthDate
      gender
      address {
        type
        line
        city
        district
        state
        postalCode
        country
      }
    }
  }
` ; export const FETCH_PERSON_NID = gql `
  query fetchPersonByNID($dob: String!, $nid: String!, $country: String) {
    queryPersonByNidIdentifier(dob: $dob, nid: $nid, country: $country) {
      name {
        use
        firstNames
        familyName
      }
      gender
    }
  }
` ; export const transformPersonData = ( response ) => { const responseData = response . data . queryPersonByNidIdentifier as GQLPerson ; return responseData ; } ; export const transformInformantData = ( response ) => { const responseData = response . data . queryPersonByNidIdentifier as GQLPerson ; return { individual : responseData } ; } ;