Urigo / SOFA

The best way to create REST APIs - Generate RESTful APIs from your GraphQL Server

Home Page:https://www.the-guild.dev/graphql/sofa-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error launching the app

kavya-medcharla opened this issue · comments

I am a newbie working on GraphQL. When I try to expose GraphQL via Rest endpoints using SOFA as mentioned in the readme docs. However, I get the below error. Let me know what's missing.

Error:
app.use('/api', useSofa({
^
TypeError: useSofa is not a function

Screenshot 2023-05-12 at 4 07 06 PM

const { useSofa } = require('sofa-api');
It is a named export from sofa-api.

So can't I use the way I used in line# 12? Also, I would like to test with a remotely hosted GraphQL API. Can you help me with pointers?

Please share an initial example as a draft on CodeSandbox or StackBlitz, so let's continue there.