fragment ProposalEventFields on Proposal {
  id
  reference
  state
  rejectionReason
  errorDetails
}

subscription ProposalEvent($partyId: ID!) {
  proposals(partyId: $partyId) {
    ...ProposalEventFields
  }
}

fragment UpdateNetworkParameterProposal on Proposal {
  id
  state
  datetime
  terms {
    enactmentDatetime
    change {
      ... on UpdateNetworkParameter {
        ...UpdateNetworkParameterFields
      }
    }
  }
}

subscription OnUpdateNetworkParameters {
  proposals {
    ...UpdateNetworkParameterProposal
  }
}

query ProposalOfMarket($marketId: ID!) {
  proposal(id: $marketId) {
    id
    terms {
      enactmentDatetime
    }
  }
}

query SuccessorMarketProposalDetails($proposalId: ID!) {
  proposal(id: $proposalId) {
    id
    terms {
      change {
        ... on NewMarket {
          successorConfiguration {
            parentMarketId
            insurancePoolFraction
          }
        }
      }
    }
  }
}

query InstrumentDetails($marketId: ID!) {
  market(id: $marketId) {
    tradableInstrument {
      instrument {
        code
        name
      }
    }
  }
}
