Comments (8)
Just commented on the PR; the second argument to mutateAndGetPayload
is a GraphQLResolveInfo
, which should contain the rootValue
in it.
Let me know if this solves the issue!
from graphql-relay-js.
Looks like this was resolved in the discussion on #16.
from graphql-relay-js.
@YourDeveloperFriend
I still don't understand How you get it solved?
I am trying to get the session value as well. and I also followed this : [express-graphql|https://github.com/graphql/express-graphql#advanced-options]
when my page is loaded, not even doing any mutation, from GraphQL I want to be able to access the value in my session, and from the session value, I want to do something.
How should I do it?
I tried this:
var queryType = new GraphQLObjectType({
name: 'Query',
fields: () => ({
node: nodeField,
// Add your own root fields here
viewer: {
type: userType,
resolve: ({rootValue}) => {
return getViewer();
},
},
}),
});
When the page is loaded, it says rootValue is undefined
from graphql-relay-js.
// It's possible your issue is this line:
// resolve: ({rootValue}) => {
// Try removing the brackets:
resolve: (rootValue) => {
console.log(rootValue);
console.log(arguments);
}
from graphql-relay-js.
Hi I have got it done
it should be resolve(parentValue, _, {rootValue:{session}})
Thanks.
from graphql-relay-js.
Hey @YourDeveloperFriend im trying to implement a login to, and i want to create the cooki inside the mutateAndGetPayload
its that possible? so i can set res.cookie('token', 'mytokencreated'); @josephsavona any idea?
from graphql-relay-js.
The second argument does not seem to have a rootValue
from graphql-relay-js.
@prijindal the third one has, the second one is seems to be the request
object.
from graphql-relay-js.
Related Issues (20)
- Update master to main HOT 1
- Build error in ./resources/prepublish.sh
- New release? HOT 6
- Return type check problem of mutationWithClientMutationId after 0.7.0 update HOT 3
- Is the peer dependency on graphql exactly 15.5.1 on purpose? HOT 3
- RangeError: Invalid code point HOT 2
- Are filtering operators supported? HOT 1
- isPromise is not a function HOT 3
- Add support for `graphql@v16`
- Can I return a union type on `outputFields`?
- Does anyone use this package with their Nest.js server?
- Merge the `graphql-relay-subcription` into `graphql-relay-js`? HOT 1
- Migrate from `chai` to `jest`?
- 0.10.0 connections causing compile error HOT 3
- To use this plugin is it necessary to get all records from the database with one request?
- filters connectionFromArray HOT 1
- Export pageInfoType
- 0.10.0 has no Flow type support HOT 4
- Make fields on PageInfo type shareable
- Compile error: 'NotSupportedTSVersion.d.ts' is not a module. HOT 1
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 graphql-relay-js.