Skip to content

Instantly share code, notes, and snippets.

@sfroestl
Last active February 24, 2016 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfroestl/3da1663ff4d779a99a63 to your computer and use it in GitHub Desktop.
Save sfroestl/3da1663ff4d779a99a63 to your computer and use it in GitHub Desktop.
import Relay from 'generic-relay';
export default class AttendConferenceMutation extends Relay.Mutation {
/* ... */
getFatQuery() {
return Relay.QL`
fragment on AttendConferencePayload {
conference {
attendance,
userIsAttending
},
user {
attendingConferences
},
conferenceEdge {
node
}
}
`;
}
getConfigs() {
return [{
type: 'FIELDS_CHANGE',
fieldIDs: { conference: this.props.conference.id },
}, {
type: 'RANGE_ADD',
parentName: 'user',
parentID: this.props.user.id,
connectionName: 'attendingConferences',
edgeName: 'conferenceEdge',
rangeBehaviors: {
'': 'append',
},
}];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment