import gql from 'graphql-tag' ; import { client } from '@client/utils/apolloClient' ; export const FETCH_USER = gql `
  query ($userId: String!) {
    getUser(userId: $userId) {
      userMgntUserID
      practitionerId
      mobile
      role
      type
      status
      name {
        use
        firstNames
        familyName
      }
      catchmentArea {
        id
        name
        alias
        status
        identifier {
          system
          value
        }
      }
      primaryOffice {
        id
        name
        alias
        status
      }
      localRegistrar {
        name {
          use
          firstNames
          familyName
        }
        role
        signature {
          data
          type
        }
      }
    }
  }
` ; async function fetchUserDetails ( userId ) { return ( client && client . query ( { query : FETCH_USER , variables : { userId } } ) ) ; } export const queries = { fetchUserDetails } ;