/graphql-relay-mutationify

Turn javascript objects into a relay mutation input friendly string

Primary LanguageJavaScriptMIT LicenseMIT

graphql-relay-mutationify

Turn javascript objects into a relay mutation input friendly string.

import mutationify from 'graphql-relay-mutationify';

mutationify({
  firstName: 'Mick',
  lastName: 'Hansen',
  count: 30
}); // {firstName: "Mick", lastName: "Hansen", count: 30}
import mutationify from 'graphql-relay-mutationify';

let input = {
  firstName: 'Mick',
  lastName: 'Hansen',
  count: 30
};

let query = `
  mutation {
    updateProfile(input: {profile: ${mutationify(input)}}) {
      profile
    }
  }
`;