Skip to content

Instantly share code, notes, and snippets.

View MartinElvar's full-sized avatar

Martin Elvar MartinElvar

  • Copenhagen, Denmark
View GitHub Profile
defmodule GraphqlHelpers do
import Ecto.Query
@doc """
## example
field :storages, list_of(:storage), do: has_many(:storages)
"""
defmacro has_many(model) do
quote do
resolve fn subject, _, _ ->
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Container, Row, Col } from "reactstrap";
import { graphql } from "react-apollo";
import { withRouter } from "react-router";
import ArticleCard from "../../components/ArticleCard";
import Paginator from "../../components/Paginator";
import TAG_QUERY from "../../graphql/queries/TagQuery.graphql";
import MORE_ARTICLES_TAG_QUERY from "../../graphql/queries/MoreArticlesTagQuery.graphql";