How to use @graffy/fill - 5 common examples

To help you get started, we’ve selected a few @graffy/fill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github usegraffy / graffy / example / server.js View on Github external
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import express from 'express';

import Graffy from '@graffy/core';
import GraffyFill from '@graffy/fill';
// import GraffyCache from '@graffy/cache';
import GraffyServer from '@graffy/server';
import mock from './mockVisitorList';

const __dirname = dirname(fileURLToPath(import.meta.url));

const g = new Graffy();
g.use(GraffyFill());
g.use(mock);

const app = express();
app.use('/api', GraffyServer(g));
app.use(express.static(__dirname + '/public'));
app.listen(8443);

// eslint-disable-next-line no-console
console.log('Server started at 8443');
github usegraffy / graffy / example / client.js View on Github external
import '@babel/polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import Graffy from '@graffy/core';
import GraffyFill from '@graffy/fill';
import GraffyClient from '@graffy/client';
// import mock from './mockVisitorList';
import { GraffyProvider } from '@graffy/react';

import App from './components/App';
// import './index.css';

const store = new Graffy();
store.use(GraffyFill());
// store.use(mock);
store.use(GraffyClient('/api'));

ReactDOM.render(
  
    
  ,
  document.getElementById('root'),
);
github usegraffy / graffy / site-bak / index.js View on Github external
import '@babel/polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import Graffy from '@graffy/core';
import GraffyFill from '@graffy/fill';
import GraffyClient from '@graffy/client';
// import mock from './mockVisitorList';
import { GraffyProvider } from '@graffy/react';

import App from './components/App';
// import './index.css';

const store = new Graffy();
store.use(GraffyFill());
// store.use(mock);
store.use(GraffyClient('/api'));

ReactDOM.render(
  
    
  ,
  document.getElementById('root'),
);
github usegraffy / graffy / src / website / components / Demo / index.js View on Github external
import React, { useState } from 'react';
import Graffy from '@graffy/core';
import GraffyFill from '@graffy/fill';
import { GraffyProvider } from '@graffy/react';

import Source, { provider } from './Source';
import Query from './Query';
import Result from './Result';

const store = new Graffy();
store.use(GraffyFill());
store.use(provider);

export default function Demo() {
  const [query, setQuery] = useState({
    players: [{ first: 2 }, { name: true, score: true }],
  });

  const [expanded, setExpanded] = useState('result');
  const paneProps = name => ({
    ...(expanded === name ? { 'data-expanded': 'true' } : {}),
    tabIndex: 0,
    onFocus: () => setExpanded(name),
    onBlur: () => setExpanded('result'),
  });

  return (
github usegraffy / graffy / src / graffy / index.js View on Github external
export default function(options) {
  const store = new Graffy();
  store.use(Fill(options));
  store.use(Cache(options));
  return store;
}

@graffy/fill

Graffy module for fulfilling queries using multiple backends, traversing links and turning subscriptions into live queries.

Apache-2.0
Latest version published 6 months ago

Package Health Score

62 / 100
Full package analysis

Popular @graffy/fill functions

Similar packages