import { gql } from "graphql-tag";

export const personTypeDefs = gql`
    scalar Date

    type Person {
        _id: ID!
        firstName: String!
        surname: String!
        middleName: String!
        sexCode: String!
        personRef: String!
        personTag: String!
        fatherName: String!
        motherName: String!
        countryCode: String!
        nationalIdentityId: String!
        birthPlace: String!
        birthDate: Date!
        taxNo: String!
        birthname: String!
    }

    input CreatePersonInput {
        firstName: String!
        surname: String!
        middleName: String!
        sexCode: String!
        personRef: String!
        personTag: String!
        fatherName: String!
        motherName: String!
        countryCode: String!
        nationalIdentityId: String!
        birthPlace: String!
        birthDate: Date!
        taxNo: String!
        birthname: String!
    }

    type Query {
        persons: [Person!]!
        person(id: ID!): Person
    }

    type Mutation {
        createPerson(input: CreatePersonInput!): Person!
    }
`;
