Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Commit

Permalink
Relay 7.0.0
Browse files Browse the repository at this point in the history
Currently blocked on this: facebook/relay#2894

adeira-source-id: 94000a04ce27fbd250c7e4dffb188b50fc9be25b
  • Loading branch information
mrtnzlml authored and adeira-github-bot committed Nov 8, 2019
1 parent 7ec28e3 commit 5a0d6ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"flow-bin": "^0.110.1",
"graphql": "^14.5.8",
"react-test-renderer": "^16.11.0",
"relay-test-utils": "^6.0.0"
"relay-test-utils": "^7.0.0"
},
"scripts": {
"start": "next",
Expand Down
4 changes: 3 additions & 1 deletion src/LocalForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
graphql,
LocalQueryRenderer,
} from '@kiwicom/relay';
// FIXME:
import { generateClientID } from 'relay-runtime'; // eslint-disable-line import/no-extraneous-dependencies
import { InputField, Textarea, Heading, Text, Separator, Stack } from '@kiwicom/orbit-components';

import type { LocalFormQueryResponse } from './__generated__/LocalFormQuery.graphql';
Expand All @@ -28,7 +30,7 @@ function getLocalStorageData(): LocalData {

function persist(data: LocalData) {
return commitLocalUpdate(environment, store => {
const dataID = 'local:LocalForm';
const dataID = generateClientID('local', 'form');
const record = store.get(dataID) ?? store.create(dataID, 'LocalForm');
for (const [key, value] of Object.entries(data)) {
// eslint-disable-next-line no-console
Expand Down
7 changes: 0 additions & 7 deletions src/createRelayEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ export default function createRelayEnvironment(initialData: ?RecordMap): Environ
'X-Client': 'https://github.com/kiwicom/relay-example',
});

const graphiQLPrinter = (request, variables) => {
return `${resource}/?query=${encodeURIComponent(request.text)}&variables=${encodeURIComponent(
JSON.stringify(variables),
)}`;
};

return createEnvironment({
fetchFn,
graphiQLPrinter,
records: initialData,
});
}

0 comments on commit 5a0d6ed

Please sign in to comment.