graphql/yoga-server/docs/features/sofa-api #2015
Replies: 7 comments 19 replies
-
I get these error messages: Module '"graphql-yoga"' has no exported member 'createSchema' and in createYoga i get this: 'schema' is declared here any ideas why this is happening |
Beta Was this translation helpful? Give feedback.
-
How can I get the json schema from the server to be imported to my docs? |
Beta Was this translation helpful? Give feedback.
-
How do you get headers attached to all the swagger methods? |
Beta Was this translation helpful? Give feedback.
-
how to add tags to swagger? it have tag key but in document don't explain that. |
Beta Was this translation helpful? Give feedback.
-
How would you attach attach a header only to some swagger methdos and not to all (securityScheme)?
|
Beta Was this translation helpful? Give feedback.
-
const yoga = createYoga({
landingPage: true,
schema: createSchema({ typeDefs, resolvers }),
plugins: [
useSofa({
basePath: '/api',
swaggerUI: {
endpoint: '/swagger'
},
openAPI: {
info: {
title: 'Bun Server REST API',
version: '1.0.0',
description: 'Bun Server REST API'
}
},
})
]
},) I call rest api on swagger successfully. but when calling on graphql, the following error is reported. Haven't called the server yet {
"errors": [
{
"message": "Failed to fetch",
"extensions": {
"requestBody": {
"query": "query MyQuery {\n getPost(id: 1) {\n content\n title\n id\n }\n}",
"operationName": "MyQuery"
},
"responseDetails": {}
}
}
]
} but when I remove the plugin, graphql works normally const yoga = createYoga({
landingPage: true,
schema: createSchema({ typeDefs, resolvers }),
// plugins: [
// useSofa({
// basePath: '/api',
// swaggerUI: {
// endpoint: '/swagger'
// },
// openAPI: {
// info: {
// title: 'Bun Server REST API',
// version: '1.0.0',
// description: 'Bun Server REST API'
// }
// },
// })
// ]
},) {
"data": {
"getPost": null
}
} |
Beta Was this translation helpful? Give feedback.
-
This plugin is not working on nestjs, I followed the instructions, it does not throw any error, but /swagger endpoint does not exist when I try to get it |
Beta Was this translation helpful? Give feedback.
-
graphql/yoga-server/docs/features/sofa-api
GraphQL Yoga Documentation
https://the-guild.dev/graphql/yoga-server/docs/features/sofa-api
Beta Was this translation helpful? Give feedback.
All reactions