Skip to content

Commit

Permalink
fix: GQL newMessage data field
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Mar 11, 2020
1 parent e1cee0e commit 48181b9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"docs": "ts-node ./scripts/generate-docs.ts && api-documenter markdown -i ./tmpapi -o ./docs/api && rm -rf ./tmpapi",
"test": "jest --config=jest.json",
"test:watch": "jest --config=jest.json --watch",
"daf": "./packages/daf-cli/bin/daf.js"
"daf": "./packages/daf-cli/bin/daf.js",
"build-clean": "rimraf ./packages/*/build ./packages/*/node_modules ./packages/*/tsconfig.tsbuildinfo"
},
"workspaces": [
"packages/*"
Expand All @@ -32,6 +33,7 @@
"lerna-changelog": "^0.8.3",
"prettier": "^1.19.1",
"pretty-quick": "^2.0.1",
"rimraf": "^3.0.2",
"semantic-release": "^16.0.0-beta.31",
"ts-jest": "^24.1.0",
"ts-node": "^8.6.2",
Expand Down
9 changes: 8 additions & 1 deletion packages/daf-core/src/graphql/graphql-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const newMessage = async (
args: { raw: string; sourceType: string; sourceId?: string },
ctx: Context,
) => {
return await ctx.core.validateMessage(
const message = await ctx.core.validateMessage(
new Message({
raw: args.raw,
meta: {
Expand All @@ -21,6 +21,13 @@ const newMessage = async (
},
}),
)

const res = {
...message,
data: JSON.stringify(message.data),
id: message.id,
}
return res
}

const serviceMessagesSince = async (
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9078,6 +9078,13 @@ rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
dependencies:
glob "^7.1.3"

rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
dependencies:
glob "^7.1.3"

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.0.0.tgz#9db384ff4b89a8f61563d92395d8625b18f3afb0"
Expand Down

0 comments on commit 48181b9

Please sign in to comment.