// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`fieldAuthorizePlugin always throws an error, even when formatError is wrong 1`] = `
Array [
  "Non-Error value undefined returned from custom formatError in authorize plugin",
]
`;

exports[`fieldAuthorizePlugin field-level authorize fails returning a Promise for an error 1`] = `
Array [
  "Guarded error Not authorized",
]
`;

exports[`fieldAuthorizePlugin field-level authorize fails returning a Promise for false 1`] = `
Array [
  "Guarded error Not authorized",
]
`;

exports[`fieldAuthorizePlugin field-level authorize fails returning an error 1`] = `
Array [
  "Guarded error You shall not pass.",
]
`;

exports[`fieldAuthorizePlugin field-level authorize fails returning false 1`] = `
Array [
  "Guarded error Not authorized",
]
`;

exports[`fieldAuthorizePlugin field-level authorize fails throwing an error 1`] = `
Array [
  "Guarded error You shall not pass.",
]
`;

exports[`fieldAuthorizePlugin field-level authorize fails with any other value 1`] = `
Array [
  "Guarded error Nexus authorize for Query.userInvalidValue Expected a boolean or Error, saw 1",
]
`;

exports[`fieldAuthorizePlugin printing the authorize schema: Full Type Output 1`] = `
"/**
 * This file was generated by Nexus Schema
 * Do not make changes to this file directly
 */


import { FieldAuthorizeResolver } from \\"@nexus/schema/dist/plugins/fieldAuthorizePlugin\\"




declare global {
  interface NexusGen extends NexusGenTypes {}
}

export interface NexusGenInputs {
}

export interface NexusGenEnums {
}

export interface NexusGenRootTypes {
  Query: {};
  String: string;
  Int: number;
  Float: number;
  Boolean: boolean;
  ID: string;
}

export interface NexusGenAllTypes extends NexusGenRootTypes {
}

export interface NexusGenFieldTypes {
  Query: { // field return type
    ok: boolean; // Boolean!
  }
}

export interface NexusGenArgTypes {
}

export interface NexusGenAbstractResolveReturnTypes {
}

export interface NexusGenInheritedFields {}

export type NexusGenObjectNames = \\"Query\\";

export type NexusGenInputNames = never;

export type NexusGenEnumNames = never;

export type NexusGenInterfaceNames = never;

export type NexusGenScalarNames = \\"Boolean\\" | \\"Float\\" | \\"ID\\" | \\"Int\\" | \\"String\\";

export type NexusGenUnionNames = never;

export interface NexusGenTypes {
  context: any;
  inputTypes: NexusGenInputs;
  rootTypes: NexusGenRootTypes;
  argTypes: NexusGenArgTypes;
  fieldTypes: NexusGenFieldTypes;
  allTypes: NexusGenAllTypes;
  inheritedFields: NexusGenInheritedFields;
  objectNames: NexusGenObjectNames;
  inputNames: NexusGenInputNames;
  enumNames: NexusGenEnumNames;
  interfaceNames: NexusGenInterfaceNames;
  scalarNames: NexusGenScalarNames;
  unionNames: NexusGenUnionNames;
  allInputTypes: NexusGenTypes['inputNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['scalarNames'];
  allOutputTypes: NexusGenTypes['objectNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['unionNames'] | NexusGenTypes['interfaceNames'] | NexusGenTypes['scalarNames'];
  allNamedTypes: NexusGenTypes['allInputTypes'] | NexusGenTypes['allOutputTypes']
  abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames'];
  abstractResolveReturn: NexusGenAbstractResolveReturnTypes;
}


declare global {
  interface NexusGenPluginTypeConfig<TypeName extends string> {
  }
  interface NexusGenPluginFieldConfig<TypeName extends string, FieldName extends string> {
    /**
     * Authorization for an individual field. Returning \\"true\\"
     * or \\"Promise<true>\\" means the field can be accessed.
     * Returning \\"false\\" or \\"Promise<false>\\" will respond
     * with a \\"Not Authorized\\" error for the field.
     * Returning or throwing an error will also prevent the
     * resolver from executing.
     */
    authorize?: FieldAuthorizeResolver<TypeName, FieldName>
  }
  interface NexusGenPluginSchemaConfig {
  }
}"
`;

exports[`fieldAuthorizePlugin warns and adds the authorize plugin when a schema has an authorize prop but no plugins 1`] = `
Array [
  "The GraphQL Nexus \\"authorize\\" feature has been moved to a plugin, add [fieldAuthorizePlugin()] to your makeSchema plugin config to remove this warning.",
]
`;

exports[`fieldAuthorizePlugin warns when a field has a non-function authorize prop 1`] = `
Array [
  [Error: The authorize property provided to incorrectFieldConfig with type User! should be a function, saw number],
]
`;
