Giter Club home page Giter Club logo

Comments (8)

GQAdonis avatar GQAdonis commented on June 8, 2024

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.

eddyystop avatar eddyystop commented on June 8, 2024

What are the contents of src/services/graphql/graphql.schema.?s of your project?

from cli.

GQAdonis avatar GQAdonis commented on June 8, 2024

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.

eddyystop avatar eddyystop commented on June 8, 2024

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.

eddyystop avatar eddyystop commented on June 8, 2024

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.

GQAdonis avatar GQAdonis commented on June 8, 2024

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.

eddyystop avatar eddyystop commented on June 8, 2024

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.

eddyystop avatar eddyystop commented on June 8, 2024

I believe we can close this issue as no reply has been received in 28 days.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.