import gql from 'graphql-tag';

export default gql`
  input AirtableRecord {
    id: String!
    fields: JSON!
  }

  input RecordInput {
    airtable_base_id: String!
    airtable_table_id: String!
    airtable_records: [AirtableRecord!]!
  }

  # Record is a reserved word in typescript
  type AT_Record implements Model {
    # Model
    id: ID!
    created_at: Date!
    updated_at: Date!

    # Props
    shopify_object_type: ShopifyObjectType!
    airtable_record_id: String!
    airtable_record: JSON!
    airtable_table_id: String!
    airtable_base_id: String!
    sync_to_shopify_status: SyncToShopifyStatus
    synced_to_shopify_at: Date
    sync_to_shopify_started_at: Date
    sync_to_shopify_failed_at: Date
    sync_to_shopify_error: JSON

    # Foreign keys
    shopify_entity_id: String
    table_id: String!
    base_id: String!
    account_id: String!
  }
`;
