How to use the nexus.interfaceType function in nexus

To help you get started, we’ve selected a few nexus 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 jferrettiboke / stripe-graphql / src / graphql / _interfaces / Node.ts View on Github external
import { interfaceType } from "nexus";

export const Node = interfaceType({
  name: "Node",
  description: "A Node is a resource with a globally unique identifier",
  definition(t) {
    t.id("id", {
      description: "Unique identifier for the object.",
      resolve: o => o.id
    });
    t.string("object", {
      description: "String representing the object's type.",
      resolve: o => o.object
    });
    t.resolveType(() => null);
  }
});
github jferrettiboke / stripe-graphql / src / graphql / products / Product.ts View on Github external
import { interfaceType } from "nexus";

export const ProductInterface = interfaceType({
  name: "Product",
  definition(t) {
    t.id("id", { description: "Unique identifier for the object." });
    t.string("object", {
      description:
        "String representing the object’s type. Objects of the same type share the same value."
    });
    t.boolean("active", {
      description: "Whether the product is currently available for purchase."
    });
    t.int("created", {
      description:
        "Time at which the object was created. Measured in seconds since the Unix epoch."
    });
    t.boolean("livemode", {
      description: