bazaar-graphql
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "bazaar-graphql", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,4 +26,2 @@ const { | ||
const getResourceClassfication = async (id, sbot) => { | ||
@@ -145,2 +143,23 @@ const resourceClassification = await message({ id }, sbot) | ||
const Mutation = { | ||
publishResource: async (_, { input }, { sbot }) => { | ||
const classification = await publish(Object.assign({ type: resourceClassficationType }, { | ||
category: input.category | ||
}), sbot) | ||
.then(msg => Object.assign({ key: msg.key }, msg.value.content )) | ||
const prices = getPrices(input.prices) | ||
return publish(Object.assign({ type: economicResourceType, createdDate: new Date() }, { | ||
currentOwner: input.owner, | ||
prices: input.prices, | ||
resourceClassifiedAs: classification.key | ||
}), sbot) | ||
.then(msg => { | ||
return { | ||
key: msg.key, | ||
category: classification.category, | ||
prices, | ||
user: msg.value.content.currentOwner, | ||
} | ||
}) | ||
}, | ||
unpublishResource: async (_, { id }, { sbot }) => { | ||
@@ -147,0 +166,0 @@ const affectedResource = await getEconomicResource(id, sbot) |
@@ -45,2 +45,7 @@ const Price = ` | ||
const Mutation = ` | ||
input ResourceInput { | ||
category: String! | ||
owner: String! | ||
prices: [String] | ||
} | ||
input TransactionInput { | ||
@@ -54,2 +59,3 @@ provider: String! | ||
type Mutation { | ||
publishResource(input: ResourceInput): Resource | ||
unpublishResource(id: String!): Resource | ||
@@ -56,0 +62,0 @@ transaction(input: TransactionInput): Transaction |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8075
256