UNPKG

@leosprograms/vf-graphql

Version:

Reference GraphQL implementation of the ValueFlows spec

152 lines (115 loc) 4.02 kB
// Generated by scripts/build.js - edit the *.gql file instead! module.exports = ` ## # # Proposal module # # Allows grouping of many intents (requests or offers) into a related proposal for actioning. # # @package vf-graphql # @since 2019-02-11 # ## """ Published requests or offers, sometimes with what is expected in return. """ type Proposal { id: ID! revisionId: ID! "An informal or formal textual identifier for a proposal. Does not imply uniqueness." name: String "The beginning time of proposal publication." hasBeginning: DateTime "The end time of proposal publication." hasEnd: DateTime "This proposal contains unit based quantities, which can be multiplied to create commitments; commonly seen in a price list or e-commerce." unitBased: Boolean "The date and time the proposal was created." created: DateTime "A textual description or comment." note: String ############################################################################## # inverse relationships and queries publishes: [ProposedIntent!] } """ Represents many-to-many relationships between Proposals and Intents, supporting including intents in multiple proposals, as well as a proposal including multiple intents. """ type ProposedIntent { id: ID! revisionId: ID! "This is a reciprocal intent of this proposal, not primary. Not meant to be used for intent matching." reciprocal: Boolean "The published proposal which this intent is part of." publishedIn: Proposal! # see bridging/intent.proposal.gql for the relationship between ProposedIntent and Intent } ## # API input and output types ## input ProposalCreateParams { "An informal or formal textual identifier for a proposal. Does not imply uniqueness." name: String "The beginning time of proposal publication." hasBeginning: DateTime "The end time of proposal publication." hasEnd: DateTime "This proposal contains unit based quantities, which can be multipied to create commitments; commonly seen in a price list or e-commerce." unitBased: Boolean "A textual description or comment." note: String "The date and time the proposal was created." created: DateTime # :TODO: should this be generated by the backend, or is it human-provided data? } input ProposalUpdateParams { revisionId: ID! "An informal or formal textual identifier for a proposal. Does not imply uniqueness." name: String "The beginning date/time of proposal publication." hasBeginning: DateTime "The end time of proposal publication." hasEnd: DateTime "This proposal contains unit based quantities, which can be multipied to create commitments; commonly seen in a price list or e-commerce." unitBased: Boolean "A textual description or comment." note: String } type ProposalResponse { proposal: Proposal! } type ProposedIntentResponse { proposedIntent: ProposedIntent! } type ProposalConnection { edges: [ProposalEdge!]! pageInfo: PageInfo! } type ProposalEdge { node: Proposal! cursor: String! } type Query { proposal(id: ID!): Proposal proposals(first: Int, after: String, last: Int, before: String): ProposalConnection! "List all proposals that are being listed as offers." offers(first: Int, after: String, last: Int, before: String): ProposalConnection! "List all proposals that are being listed as requests." requests(first: Int, after: String, last: Int, before: String): ProposalConnection! } type Mutation { createProposal(proposal: ProposalCreateParams!): ProposalResponse! updateProposal(proposal: ProposalUpdateParams!): ProposalResponse! deleteProposal(revisionId: ID!): Boolean! """ Include an existing intent as part of a proposal. @param publishedIn the (\`Proposal\`) to include the intent in @param publishes the (\`Intent\`) to include as part of the proposal """ proposeIntent( publishedIn: ID! publishes: ID! reciprocal: Boolean ): ProposedIntentResponse! deleteProposedIntent(revisionId: ID!): Boolean! } `