Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduardo Matos eduardojmatos

View GitHub Profile
View linking-service-with-category.js
export default `
extend type Service {
category: Category
}
`;
View server-fetcher.js
import apolloFetch from 'apollo-fetch';
const serverFetcher = apolloFetch.createApolloFetch({
uri: 'https://endpoint-of-graphql.com',
});
export default serverFetcher;
View schema-builder.js
import graphqlTools from 'graphql-tools';
const schemaBuilder = async fetcher => graphqlTools.makeRemoteExecutableSchema({
schema: await graphqlTools.introspectSchema(fetcher),
fetcher,
});
export default schemaBuilder;
View merge-schemas.js
import graphqlTools from 'graphql-tools';
import serverOneFetcher from './server-fetcher-one';
import serverTwoFetcher from './server-fetcher-two';
import SchemaBuilder from './schema-builder';
import serviceStitching from './stitching-service';
import linkServiceCategorySchema from './link-service-with-category';
const schemas = [];
const fetchers = {
serverOne: serverOneFetcher,
View stitching-service.js
const serviceStitching = function (mergeInfo) {
return {
Service: {
category: {
fragment: 'fragment CategoryTypeFragment on Category { slug }',
resolve(parent, args, context, info) {
return mergeInfo.delegate(
'query',
'category',
{ slug: parent.categorySlug },
@eduardojmatos
eduardojmatos / link-service-with-category.js
Created Jan 21, 2018
Sample of merge Schemas using stitching
View link-service-with-category.js
@eduardojmatos
eduardojmatos / frontendbr-forum-top-activity-users.md
Last active May 20, 2020
List of all users by activities on FrontendBR#forum
View frontendbr-forum-top-activity-users.md
View geckodriver-on-linux.sh
cd /bin
# Check on https://github.com/mozilla/geckodriver/releases for the latest release
wget https://github.com/mozilla/geckodriver/releases/download/v0.14.0/geckodriver-v0.14.0-linux64.tar.gz
tar -xvzf geckodriver-v0.14.0-linux64.tar.gz
rm geckodriver-v0.14.0-linux64.tar.gz
chmod +x geckodriver
cp geckodriver wires
export PATH=$PATH:/bin/wires
export PATH=$PATH:/bin/geckodriver
View dabblet.css
section {
max-width: min-content;
margin: auto;
border: 1px solid #000;
}
section p {
padding: 10px;
background-color: green;
color: #fff;
}
View dabblet.css
section {
max-width: max-content;
margin: auto;
border: 1px solid #000;
}
section p {
padding: 10px;
background-color: yellow;
}
You can’t perform that action at this time.