graphql-apollo | GraphQL library
kandi X-RAY | graphql-apollo Summary
kandi X-RAY | graphql-apollo Summary
graphql-apollo
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of graphql-apollo
graphql-apollo Key Features
graphql-apollo Examples and Code Snippets
Community Discussions
Trending Discussions on graphql-apollo
QUESTION
Beeing new to vue testing, I'm trying to make an integration test for our Vue SPA with axios & mocha.
I want some of the tests to make real api calls to our server without mocking, to figure out if it really works from the beginning to the end. The server API is a Laravel 7 app with laravel/sanctum and cookie based session authentication.
I can make real axios calls directly in the test file like this:
...ANSWER
Answered 2020-Jun-15 at 11:56Found out that cypress and nightwatch are the right tools for end-to-end testing (e2).
Didn't know the right terms (e2e or end-to-end testing) and the right tools.
Switched to cypress.io - absolutly great.
vue-cli even has first hand plugins to integrate cypress or nightwatch: https://cli.vuejs.org/core-plugins/e2e-cypress.html
QUESTION
I try to implement the Search function into my management system using React-Hooks and GraphQL-Apollo Client. While the interface is shown successfully, when I press the 'Search' button it came out an error which named:
Invalid hook call. Hooks can only be called inside of the body of a function component.
I'm pretty sure the useQuery
is being called inside a function, so I do not understand what will cause this. The other function such as display all users and add new users are working fine.
I have tried a couple of ways to implement the search function and search around online while still couldn't get it solve. This is my first time encounters React-Hooks too.
Here is my current code in the searchUser
component
ANSWER
Answered 2019-Apr-28 at 16:22According to the Rules of Hooks:
Don’t call Hooks from regular JavaScript functions. Instead, you can:
✅ Call Hooks from React function components.
✅ Call Hooks from custom Hooks (we’ll learn about them on the next page).
If you need to manually call a query manually ins response to an event, use the Apollo client directly. You can use useApolloClient
to get an instance of the client inside your component:
QUESTION
I started to learn nestjs and tried this example with graphql.
But the example was written for apollo-server version 1 and now I have problems to get it working with apollo-server version 2. Currently it is not clear to me how to get the apollo-server version 2 into the consumer:
...ANSWER
Answered 2018-Sep-04 at 10:22The example has been updated already (+ensure to update your @nestjs/graphql
to the latest version)
QUESTION
I'm reading a blog to separate graphql schemas and resolvers by domain.
To merge the resolvers, it makes sense.
...ANSWER
Answered 2019-Oct-26 at 13:32What the blog describes is combining type definitions like this:
QUESTION
Apollo query has the wrong data from cache in my react app.
If I set query's fetchPolicy to 'network-only', everything work properly.
So I think it is a cache problem.
I have been working hard trying to solve the problem and see articles about apollo cache, but I still can't solve the problem.
Here are my results after querying:
parameter memberId is null (result is correct)
...ANSWER
Answered 2019-Feb-10 at 07:37@Anymore - can we see you FETCH_MEMBER_LIST_QUERY code? Are you fetching id's for all the data? Without the ids it won't be able to match relations.
Have you tried using Apollo Client DevTools - they will let you easily view the contents of the cache. It can be found on GitHub here and the Chrome Webstore here
Using this you will be able to see if the item is being cached correctly.
QUESTION
I am using the schema stitching (as demonstrated here) in a typescript express app.
IssueCreating resolvers in different files seems to create build issues. However, creating resolvers in app.ts
(as shown below) is fine.
ANSWER
Answered 2019-Jul-01 at 02:46Typescript is irrelevant here. Either use JS spread or write into an Object separately. Like:
QUESTION
I have configured and set up a fully functional express-nextjs-graphql-apollo app that can login/logout a user, and perfectly do CRUD. The last and very important step is to display error messages on client-side.
So far, I'm only getting this red error in a console: POST http://localhost:3000/graphql 500 (Internal Server Error)
For example, a login form validation. When no input is provided, it's supposed to get an invalid input error message, or E-Mail is invalid
if email format is incorrect.
The following mutation code tested in graphql localhost:3000/graphql
:
ANSWER
Answered 2019-May-18 at 05:45After doing some research I realized that the error itself is an object
QUESTION
I am using Nodemon and ESM module to use ES6 syntax on a Express + Mongoose project. I am getting this error when compiling:
SyntaxError: The requested module 'file:///.../models/User.js' does not provide an export named 'User'
My model file (models/User.js) looks like this:
...ANSWER
Answered 2019-Apr-10 at 13:52You are mixing ES6 modules (import, export
) with CommonJS (require/module.exports
). We are going to need to replace module.exports = { User };
with export const User = mongoose.model('user', userSchema);
in order to succesfully import it as an ES6 module in your other file. You can create a named export in your model file as follows:
QUESTION
Thanks to the package @nestjs/graphql I can create separate .graphql files in each module of my application and the Nestjs system gathers them all and introduces them to Apolo server well, but the problem comes when I try to make custom scalars, I do them as is his tutorial says:
https://docs.nestjs.com/graphql/scalars
But I can not find a way to import them into a .graphql file so I could use it within that file. and since the file is .graphql the import does not work. Do you know how I can import a custom scalar to be used within a .graphql file? Something that can serve as an example is an example that they use:
https://github.com/nestjs/nest/tree/master/sample/12-graphql-apollo
As you can see them in their example they expose that they have a module called cats, where inside the module they have their cats.resolvers.ts and their cats.graphql; and on the other hand, they have their date.scalar.ts defined. The question using this example:
What should I do to use the DateScalar in a property of cats.resolvers.ts?
...ANSWER
Answered 2019-Jan-19 at 18:35I had that problem and solved it in the following way:
- First, I made the common module to set the DateScalar as provider and also to export it:
QUESTION
Ok. I officially lost my mind with this problem.
Let's take a default Rails application (5
, but I tried also with a 4
default app).
I'm trying to use a simple javascript code to send an ajax POST request to one controller action.
In my ApplicationController
I have this code:
ANSWER
Answered 2018-May-08 at 10:43The name of the header Rails expects is X_CSRF_TOKEN
(note the underscores). I don't see a problem with the rest of the code you've shared - except maybe that the token from the cookie must be URI decoded (decodeURIComponent
), so check this as well if you still get the warning.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install graphql-apollo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page