Comments (8)
Some extra information:
The code in the repo for this article (https://medium.com/@mattchewone/graphql-with-feathersjs-4cc67e785bd) works. However, when I update it using "feathers-plus generate all", that code stops working.
Something seems broken in the current release of the feathers-plus cli....
from cli.
What are the contents of src/services/graphql/graphql.schema.?s of your project?
from cli.
Thanks @eddyystop! Here are the contents of the graphql.schema.js file:
// Define the combined GraphQL schema. (Can be re-generated.)
// !code: imports // !end
// !code: init // !end
let moduleExports = `
type Role {
id: ID
name: String!
}
type User {
id: ID
email: String!
firstName: String!
lastName: String!
password: String
roleId: ID!
}
type Query {
getRole(key: JSON, query: JSON, params: JSON): Role
findRole(query: JSON, params: JSON): [Role]!
getUser(key: JSON, query: JSON, params: JSON): User
findUser(query: JSON, params: JSON): [User]!
}
`;
// !code: exports // !end
module.exports = moduleExports;
// !code: funcs // !end
// !code: end // !end
from cli.
The schema looks fine. How exactly did you make the GraphQL call? I mean was it via REST or WebSockets and what was the code making the call?
from cli.
The format for calling the graphql service within Feathers is graphql.find({ query: { query: '{ getRole(...) {...} }' } })
.
Don't forget to include the second query
in a REST call.
from cli.
Thanks again for your quick response. I am not using feathers-client to make the GraphQL call. I was using GraphIQL (the graphical Mac app) for testing. I also used CURL manually with both GET and POST requests.
As I said earlier the code base for the sample article at https://github.com/Mattchewone/feathers-graphql-demo works, but it was generated with an older version of the CLI. When upgrading this code base to the current libraries using generate all
, it stops working.
Make sense?
from cli.
Others are making GraphQL calls without issues, so let not sidetrack ourselves with Matt's repo.
I have no experience with the Mac graphql app, so I don't know if it automatically inserts a query
in front of the query string you are using, like Graphiql does. Please try a string without the shorthand syntax.
https://graphql.org/learn/queries/#operation-name
from cli.
I believe we can close this issue as no reply has been received in 28 days.
from cli.
Related Issues (20)
- Cannot start application HOT 1
- Use https on new Feathers (Buzzard) with typescript HOT 6
- Best practices of using generate with prettier HOT 3
- Sequelize.ts error HOT 2
- SQL Syntax error with Sequelize, TS and MySQL 8 ?
- regenerating service removes all hooks on service HOT 5
- app#src with multiple path directory fail to start HOT 2
- Feathers Seed MongoDB Race Condition HOT 5
- Feature Request: Add code insertion point HOT 2
- Update Changelog HOT 1
- generate HOT 1
- [Question] "mongo" & "sequelize" files for "mongoose"? HOT 4
- Service fields in mongo/mongoose/sequelize are all string/TEXT, even for numbers HOT 1
- Generated TypeScript version fails to compile - app.configure() type mismatch HOT 8
- Generated TypeScript with custom sources folder fails to "npm start" (again)
- Feature request: Add config option or code insertion point
- Unable to use npx to do a one off command with feather-plus/cli
- getDescription is not a function after generating graphql service HOT 1
- is this cli deprecated? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.