Comments (4)
I had thought it was something to do with the Apollo or cache, but even when I spin up brand new implementations it still doesn't like it.
from pup.
When do you see the 400 error? Automatically on server startup or only when making requests? If only when making requests, double-check the arguments for the query match in your schema as well as on the client (e.g., is an arg required in the schema but not in the client).
Something like:
// Schema
type Query {
someQuery(requiredArg: String!): Stuff
}
// Client
query someQuery($requiredArg: String) { // Notice that String is not marked as required here.
someQuery(requiredArg: $requiredArg) {
field
}
}
Also worth making sure that in your startup/client/apollo.js file, in the onError
callback, you're logging out all of the errors (sometimes an error gets burried here that's helpful for debugging). For example:
onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors) {
graphQLErrors.map(({ message, locations, path }) => {
console.log(message);
});
}
if (networkError) {
console.log(networkError);
}
}),
from pup.
Get no notifications in the terminal that there is an issue. Only get the issue when I go to a page that uses the call - so it doesn't load and the console shows the following error;
----from api\Users\types.js
type Friends {
userId: String
username: String
}
type User {
_id: String
name: Name
username: String
emailAddress: String
oAuthProvider: String
roles: [Role]
itchlist: [String]
wishlist: [String]
ownlist: [String]
friends: [Friends]
subscription: String
subscriptionId: String
gamePlayCounts: [GamePlayCount],
loanedTo: [LoanedTo]
borrowedFrom: [BorrowedFrom]
settings: [UserSetting] # From /api/UserSettings/types.js
}
----from ui\queries\Users.gql----
query userFromUsername($username: String) {
userFromUsername(username: $username) {
...UserAttributes,
username
wishlist
itchlist
ownlist
subscription
friends {
userId
username
}
loanedTo {
_id
userId
username
}
borrowedFrom {
_id
userId
username
}
gamePlayCounts {
_id
count
}
}
}
As for Apollo, that does have an error link - but I don't see anything in the console whent he error occurs (just in the browser console/dev tools)
const errorLink = onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors)
graphQLErrors.map(({ message, location, path }) =>
console.log(`[GraphQL error]: Message: ${message}, Location: ${location}, Path: ${path}`),
);
if (networkError) console.log(`[Network error]: ${networkError}`);
});
from pup.
OH... MY... GOH!!
Turns out, I am just an idiot. The issue was not with my code. Everything was right - and I could see that in the above. BUT, and wait for the face palm, because I am using docker images sitting side by side for the real site and the dev site I change some settings manually AND this is where the rub is. YES, I changed the code correctly and even got everything looking sexy (even though I couldn't yet see it) BUT the dev site was still looking at the live site containers gql (instead of the dev gql).
I will put some s=time into automating that deployment to docker... I am loving Docker to manage it all, but manually handling the dev to live push (by manually changing 2 values is a risk of my stupidity seeping in....)
from pup.
Related Issues (20)
- Real-time updates HOT 6
- How to Connect to a react native app with pupql HOT 4
- compose is not a function HOT 3
- Update Apollo Client and Apollo Server Usage HOT 4
- Application stuck when trying to run. HOT 4
- checkIfBlackListed does not work as expected! HOT 4
- Paste true may be necessary on e2e tests login helper
- Incorporate Code Splitting for Pup V2 & client side Redux HOT 9
- Access Meteor settings file from Jest? HOT 2
- graphQL httpUri on staging and production settings HOT 1
- How to upgrade from v1-> v2 HOT 3
- Add License File
- Wildcard instead of GraphQL? HOT 3
- Upgrade to latest version of alanning:roles HOT 1
- is this repo still maintained? HOT 9
- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3000/graphql. (Reason: CORS request did not succeed). HOT 5
- Password only oauth possible? HOT 9
- Pup is moving!
- Apollo version and hooks HOT 2
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 pup.