Awey
12/07/2020, 9:49 PMlinkPreview
query in Nexus? Given a websites url
I would like to be able to get the meta data from that site, description, images, etc. Like when you post a link here. I'm using Nexus Schema and I'm not really sure how to approach this. Any guidance would be appreciated 🙏Ryan
12/08/2020, 6:47 AMconst LinkPreview = objectType({
type: 'LinkPreview',
definition(t) {
// add the fields here returned from the REST API
}
})
const queryLinkPreview = objectType({
type: 'getLinkPreview',
args: {
// the link URL
},
resolve(parent, root, ctx) {
// call the rest api here and return the response
}
})
This is the approach I would take.Awey
12/08/2020, 11:29 PMRyan
12/09/2020, 7:38 AM