are there any examples that show how to integrate ...
# prisma-whats-new
p
are there any examples that show how to integrate a prisma service with something like a 3rd party API? I am trying to figure out how to build a web scraping application that handles events (new scrape requests) and responds with GraphQL mutations/queries
h
Or in application server you can call 3rd party apis in resolvers
But i can see server side subscription what will push webook with URL to scrape and after you scrape it you can make graphql request to your app server with results for example
But hard to say, because idk if you want to use some service to scrape or build your own scrapper etc
p
i am building my own scraper that runs on node
and would rather not setup my own webhook service
h
so make node server for scrapping and you can send url to scrape in resolver for example
👍 1
p
and just treat it as if im calling a typical HTTP api?
h
yea
p
ok that makes sense and sounds like a clean solution
thanks!
h
no problem 🙂
p
are there any samples that show resolvers like that?
h
i have something not finished for instagram api
Copy code
export const instagramMutation = {
  async upsertInstagram(parent, { id = "", accessToken, name, instagramId }, ctx: Context, info) {
    const data = {
      accessToken,
      name,
      instagramId
    }

    const FB = new Facebook({})

    FB.setAccessToken(accessToken)


    FB.api(`${instagramId}/media`, 'post', res => {
      console.log(res)
    })

    return await ctx.db.mutation.upsertInstagram(
      {
        where: {
          id
        },
        create: {
          ...data
        },
        update: {
          ...data
        }
      },
      info
    )
  }
}
but you can get feel how to do it
p
beautiful! that is very useful. thanks again 🙂
h
but sometimes i would rather scrape instagram then call their API 😄
👍 1