Skip to content

Instantly share code, notes, and snippets.

View rodrigopr's full-sized avatar

Rodrigo Ribeiro rodrigopr

View GitHub Profile
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || obj.getClass() != this.getClass()) {
return false;
}
TopChildrenQuery that = (TopChildrenQuery) obj;
function getFieldList(context, asts = context.fieldASTs) {
//for recursion...Fragments doesn't have many sets...
if (!Array.isArray(asts)) asts = [asts]
//get all selectionSets
var selections = asts.reduce((selections, source) => {
if(source.selectionSet) {
selections.push(...source.selectionSet.selections);
}
import _ from 'lodash';
import React from 'react';
import Relay from 'react-relay';
import RelayQuery from 'react-relay/lib/RelayQuery';
import GraphQLStoreQueryResolver from 'react-relay/lib/GraphQLStoreQueryResolver'
import RelayFragmentPointer from 'react-relay/lib/RelayFragmentPointer';
import RelayMetaRoute from 'react-relay/lib/RelayMetaRoute';
class DummyComponent extends React.Component {
render() {
@rodrigopr
rodrigopr / Link.react-test.js
Last active August 10, 2016 02:16
snapshot testing with enzyme (hack)
import { shallow } from 'enzyme';
const deepShallow = (endCondition) => (element) => {
let wrapper = shallow(element);
while (wrapper.node && !endCondition(wrapper)) {
wrapper = wrapper.shallow();
}
return wrapper;
}
// @flow
/* eslint-disable jsx-control-statements/jsx-jcs-no-undef, no-unused-vars */
import React from 'react';
import Relay from 'react-relay';
/*
* Type mapping:
* D - DefaultProps
test.js:5
5: const dontWork = <WrappedExample name={123} />; // it start working if we uncomment the line in the other file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ React element `WrappedExample`
5: const dontWork = <WrappedExample name={123} />; // it start working if we uncomment the line in the other file
^^^ number. This type is incompatible with
6: type ExampleProps = { name: string };
^^^^^^ string. See: container.js:6
Trace:
* path 1:
5: const dontWork = <WrappedExample name={123} />; // it start working if we uncomment the line in the other file
protoloco chamada: 2023611502227
cancelamento: 2023611709669