-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
packages/documents/lib/resolve.js
Outdated
format: resolver(meta.format), | ||
discussion: resolver(meta.discussion) | ||
discussion: resolver(meta.discussion), | ||
audioSources: meta.audioSources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not needed
# the id of the discussion itself | ||
discussionId: ID | ||
credits: JSON | ||
audioSources: [AudioSource] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be interesting... if the publikator writes something to audioSources
array that doesn't fit the AudioSource
spec, apollo is going to explode on delivery of the document. But I think this fine.
@patte I changed my mind. I'm storing flat properties (audioSourceMp3, audioSourceAac, audioSourceOgg) now in the document's meta, and resolve that to an object on the query:
|
audioSource | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metaFieldResolver is only done on publish but audioSource should be available before. therefor and because what you do here is a simple sync transform, I recommend you put it in the main Meta resolver in: servers/publikator/graphql/resolvers/Meta.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry the right place is getMeta
in packages/documents/lib/meta.js
This works everywhere (publikator- and republik-api).
lgtm, merge at will |
Kicking off backend changes for storing a reference to an audio version of an article. The current plan is to have input fields in an article's meta section for entering a URL of a previously uploaded mp3 and optionally aac and/or ogg. These may eventually turn into file upload fields.
Publikator PR: orbiting/publikator-frontend#140
Frontend PR: orbiting/republik-frontend#84