<NME> RelayMockPayloadGenerator-test.js.snap
<BEF> // Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`check context in the mock resolver 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest11Query {
  viewer {
    ...RelayMockPayloadGeneratorTest11Fragment
  }
}

fragment RelayMockPayloadGeneratorTest11Fragment on Viewer {
  actor {
    __typename
    ... on User {
      id
      name
      profile_picture {
        uri
        height
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "viewer": {
      "actor": {
        "__typename": "User",
        "id": "<mock-id-1>",
        "name": "<mock-value-for-field-\\"name\\">",
        "profile_picture": {
          "uri": "http://my-image",
          "height": 100
        }
      }
    }
  }
}
`;

exports[`generate basic mock data 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest6Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest6Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest6Fragment on User {
  id
  name
  author {
    id
    name
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "author": {
        "id": "<User-mock-id-2>",
        "name": "<mock-value-for-field-\\"name\\">"
      }
    }
  }
}
`;

exports[`generate mock and verify arguments in the context 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest14Query(
  $smallScale: Float = 1
  $bigScale: Float = 100
) {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest14Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest14Fragment on User {
  id
  name
  smallImage: profile_picture(scale: $smallScale) {
    uri
  }
  bigImage: profile_picture(scale: $bigScale) {
    uri
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "smallImage": {
        "uri": "small image"
      },
      "bigImage": {
        "uri": "big image"
      }
    }
  }
}
`;

exports[`generate mock for fragment with @argumentsDefinition 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest15Query(
  $scale: Float = 1
) {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest15Fragment_3I1js
    id
  }
}

fragment RelayMockPayloadGeneratorTest15Fragment_3I1js on User {
  id
  name
  profile_picture(scale: $scale) {
    uri
    width
    height
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">",
        "width": 42,
        "height": 42
      }
    }
  }
}
`;

exports[`generate mock for multiple fragment spreads 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest17Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest20Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest17Fragment on Page {
  id
  pageName: name
}

fragment RelayMockPayloadGeneratorTest18Fragment on User {
  id
  name
  username
}

fragment RelayMockPayloadGeneratorTest19Fragment on User {
  ...RelayMockPayloadGeneratorTest18Fragment
  profile_picture {
    uri
  }
}

fragment RelayMockPayloadGeneratorTest20Fragment on User {
  body {
    text
  }
  actor {
    __typename
    name
    id
  }
  myActor: actor {
    __typename
    ...RelayMockPayloadGeneratorTest17Fragment
    id
  }
  ...RelayMockPayloadGeneratorTest18Fragment
  ...RelayMockPayloadGeneratorTest19Fragment
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "body": {
        "text": "<mock-value-for-field-\\"text\\">"
      },
      "actor": {
        "__typename": "__MockObject",
        "name": "<mock-value-for-field-\\"name\\">",
        "id": "<mock-id-2>"
      },
      "myActor": {
        "__typename": "Page",
        "id": "<mock-id-3>",
        "pageName": "<mock-value-for-field-\\"pageName\\">"
      },
      "name": "<mock-value-for-field-\\"name\\">",
      "username": "<mock-value-for-field-\\"username\\">",
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">"
      }
    }
  }
}
`;

exports[`generate mock for objects without concrete type 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest9Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest9Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest9Fragment on Page {
  actor {
    __typename
    id
    name
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "Page",
      "actor": {
        "__typename": "__MockObject",
        "id": "<mock-id-1>",
        "name": "<mock-value-for-field-\\"name\\">"
      },
      "id": "<mock-id-2>"
    }
  }
}
`;

exports[`generate mock for plural fragment 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest16Query {
  nodes {
    __typename
    ...RelayMockPayloadGeneratorTest16Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest16Fragment on Comment {
  id
  body {
    text
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "nodes": [
      {
        "__typename": "Comment",
        "id": "<mock-id-1>",
        "body": {
          "text": "<mock-value-for-field-\\"text\\">"
        }
      }
    ]
  }
}
`;

exports[`generate mock for simple fragment 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest1Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTestFragment
    id
  }
}

fragment RelayMockPayloadGeneratorTestFragment on User {
  id
  name
  profile_picture {
    uri
    width
    height
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">",
        "width": "<mock-value-for-field-\\"width\\">",
        "height": "<mock-value-for-field-\\"height\\">"
      }
    }
  }
}
`;

exports[`generate mock for with directives and handlers 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest18Query(
  $first: Int = 10
  $picturePreset: PhotoSize
  $RELAY_INCREMENTAL_DELIVERY: Boolean = false
) {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest22Fragment_1t4y1N
    id
  }
}

fragment RelayMockPayloadGeneratorTest21Fragment on User {
  birthdate {
    month
  }
}

fragment RelayMockPayloadGeneratorTest22Fragment_1t4y1N on User {
  id
  name
  myActor: actor {
    __typename
    id
    name
  }
  customName: name
  friends(first: $first) {
    edges {
      node {
        id
        name
        __typename
      }
      cursor
    }
    myPageInfo: pageInfo {
      endCursor
      hasNextPage
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
  profile_picture {
    uri
  }
  profilePicture(preset: $picturePreset) {
    uri
  }
  ...RelayMockPayloadGeneratorTest21Fragment
  actor {
    __typename
    ... on User {
      id
      userName: name
      name: username
      profilePicture(size: 1) {
        uri
        width
        height
      }
      feedback {
        comments {
          edges {
            node {
              ...RelayMockPayloadGeneratorTest23Fragment @defer(label: "RelayMockPayloadGeneratorTest22Fragment$defer$DeferLabel", if: $RELAY_INCREMENTAL_DELIVERY)
              id
            }
          }
        }
        id
      }
    }
    ... on Page {
      id
      pageName: name
    }
    username
    id
  }
}

fragment RelayMockPayloadGeneratorTest23Fragment on Comment {
  body {
    text
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "myActor": {
        "__typename": "__MockObject",
        "id": "<mock-id-2>",
        "name": "<mock-value-for-field-\\"name\\">"
      },
      "customName": "<mock-value-for-field-\\"customName\\">",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "<User-mock-id-3>",
              "name": "<mock-value-for-field-\\"name\\">",
              "__typename": "User"
            },
            "cursor": "<mock-value-for-field-\\"cursor\\">"
          }
        ],
        "myPageInfo": {
          "endCursor": "<mock-value-for-field-\\"endCursor\\">",
          "hasNextPage": "<mock-value-for-field-\\"hasNextPage\\">"
        },
        "pageInfo": {
          "endCursor": "<mock-value-for-field-\\"endCursor\\">",
          "hasNextPage": "<mock-value-for-field-\\"hasNextPage\\">"
        }
      },
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">"
      },
      "profilePicture": {
        "uri": "<mock-value-for-field-\\"uri\\">"
      },
      "birthdate": {
        "month": "<mock-value-for-field-\\"month\\">"
      },
      "actor": {
        "__typename": "User",
        "username": "<mock-value-for-field-\\"username\\">",
        "id": "<mock-id-4>",
        "userName": "<mock-value-for-field-\\"userName\\">",
        "name": "<mock-value-for-field-\\"name\\">",
        "profilePicture": {
          "uri": "<mock-value-for-field-\\"uri\\">",
          "width": "<mock-value-for-field-\\"width\\">",
          "height": "<mock-value-for-field-\\"height\\">"
        },
        "feedback": {
          "comments": {
            "edges": [
              {
                "node": {
                  "body": {
                    "text": "<mock-value-for-field-\\"text\\">"
                  },
                  "id": "<Comment-mock-id-5>"
                }
              }
            ]
          },
          "id": "<Feedback-mock-id-6>"
        }
      }
    }
  }
}
`;

exports[`generate mock using custom mock functions 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest7Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest7Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest7Fragment on User {
  id
  name
  profile_picture {
    uri
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "my-id-1001",
      "name": "<mock-value-for-field-\\"name\\">",
      "profile_picture": {
        "uri": "http://my-uri"
      }
    }
  }
}
`;

exports[`generate mock using custom mock functions for object type (multiple object) 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest10Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest10Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest10Fragment on User {
  name
  actor {
    __typename
    ... on User {
      id
      name
      profile_picture {
        uri
        height
      }
    }
    id
  }
  profile_picture {
    uri
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "My user name",
      "actor": {
        "__typename": "User",
        "id": "<mock-id-2>",
        "name": "My user name",
        "profile_picture": {
          "uri": "http://my-image",
          "height": 100
        }
      },
      "profile_picture": {
        "uri": "http://my-image"
      }
    }
  }
}
`;

exports[`generate mock using custom mock functions for object type 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest8Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest8Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest8Fragment on Page {
  actor {
    __typename
    id
    name
  }
  backgroundImage {
    width
    uri
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "Page",
      "actor": {
        "__typename": "__MockObject",
        "id": "<mock-id-1>",
        "name": "<mock-value-for-field-\\"name\\">"
      },
      "backgroundImage": {
        "width": 200,
        "uri": "http://my-image"
      },
      "id": "<mock-id-2>"
    }
  }
}
`;

exports[`generate mock with abstract inline fragment 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest2Query {
  viewer {
    actor {
      __typename
      ...RelayMockPayloadGeneratorTest1Fragment
      id
    }
  }
}

fragment RelayMockPayloadGeneratorTest1Fragment on Actor {
  __isActor: __typename
  id
  ... on Named {
    __isNamed: __typename
    name
  }
  ... on User {
    firstName
    lastName
  }
  ... on Page {
    websites
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "viewer": {
      "actor": {
        "__typename": "User",
        "__isActor": true,
        "id": "<mock-id-1>",
        "__isNamed": true,
        "name": "<mock-value-for-field-\\"name\\">",
        "firstName": "<mock-value-for-field-\\"firstName\\">",
        "lastName": "<mock-value-for-field-\\"lastName\\">"
      }
    }
  }
}
`;

exports[`generate mock with condition (and other complications) 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest4Query(
  $showProfilePicture: Boolean!
  $hideBirthday: Boolean!
  $showBirthdayMonth: Boolean!
  $hideAuthorUsername: Boolean!
) {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest3Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest3Fragment on User {
  id
  name
  customId: id
  profile_picture @include(if: $showProfilePicture) {
    uri
  }
  birthdate @skip(if: $hideBirthday) {
    year
    month @include(if: $showBirthdayMonth)
  }
  author {
    name
    id
  }
  author @skip(if: $hideAuthorUsername) {
    authorID: id
    objectType: __typename
    username
    id
  }
  allPhones {
    phoneNumber {
      displayNumber
    }
  }
  emailAddresses
  backgroundImage {
    uri
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "customId": "<User-mock-id-2>",
      "author": {
        "name": "<mock-value-for-field-\\"name\\">",
        "id": "<User-mock-id-3>"
      },
      "allPhones": [
        {
          "phoneNumber": {
            "displayNumber": "<mock-value-for-field-\\"displayNumber\\">"
          }
        }
      ],
      "emailAddresses": "<mock-value-for-field-\\"emailAddresses\\">",
      "backgroundImage": {
        "uri": "<mock-value-for-field-\\"uri\\">"
      }
    }
  }
}
`;

exports[`generate mock with connection 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest5Query(
  $first: Int
  $skipUserInConnection: Boolean!
) {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest5Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest4Fragment on User {
  name
  username
  emailAddresses
}

fragment RelayMockPayloadGeneratorTest5Fragment on Page {
  actor {
    __typename
    ... on User {
      id
      myType: __typename
      myName: name
      name
      friends(first: $first) {
        edges {
          cursor
          node {
            id
            ...RelayMockPayloadGeneratorTest4Fragment @skip(if: $skipUserInConnection)
            __typename
          }
        }
        pageInfo {
          endCursor
          hasNextPage
        }
      }
      ...RelayMockPayloadGeneratorTest4Fragment
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "Page",
      "id": "<mock-id-1>",
      "actor": {
        "__typename": "User",
        "id": "<mock-id-2>",
        "myType": "User",
        "myName": "<mock-value-for-field-\\"myName\\">",
        "name": "<mock-value-for-field-\\"name\\">",
        "friends": {
          "edges": [
            {
              "cursor": "<mock-value-for-field-\\"cursor\\">",
              "node": {
                "id": "<User-mock-id-3>",
                "__typename": "User"
              }
            }
          ],
          "pageInfo": {
            "endCursor": "<mock-value-for-field-\\"endCursor\\">",
            "hasNextPage": "<mock-value-for-field-\\"hasNextPage\\">"
          }
        },
        "username": "<mock-value-for-field-\\"username\\">",
        "emailAddresses": "<mock-value-for-field-\\"emailAddresses\\">"
      }
    }
  }
}
`;

exports[`generate mock with inline fragment 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest3Query(
  $condition: Boolean!
) {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest2Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest2Fragment on User {
  id
  name
  author {
    id
    name
    authorID: id
    username
  }
  author @include(if: $condition) {
    myId: id
    myUsername: username
    emailAddresses
    birthdate {
      day
      month
      year
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "author": {
        "id": "<User-mock-id-2>",
        "name": "<mock-value-for-field-\\"name\\">",
        "authorID": "<User-mock-id-3>",
        "username": "<mock-value-for-field-\\"username\\">"
      }
    }
  }
}
`;

exports[`generate mock with manual mock for objects 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest12Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest12Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest12Fragment on Page {
  id
  name
  body {
    text
  }
  myTown: hometown {
    id
    name
    url
    feedback {
      comments(first: 10) {
        edges {
          cursor
          comment: node {
            id
            message {
              text
            }
            likeSentence {
              text
            }
          }
        }
        pageInfo {
          startCursor
        }
      }
      id
    }
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "Page",
      "id": "page-id-2",
      "name": "My Page",
      "body": {
        "text": "My Text"
      },
      "myTown": {
        "id": "page-id-3",
        "name": "My Hometown",
        "url": "http://node-myTown",
        "feedback": {
          "comments": {
            "edges": [
              {
                "cursor": "<mock-value-for-field-\\"cursor\\">",
                "comment": {
                  "id": "<Comment-mock-id-4>",
                  "message": {
                    "text": "Comment text: node>myTown>feedback>comments>edges>comment"
                  },
                  "likeSentence": {
                    "text": "<mock-value-for-field-\\"text\\">"
                  }
                }
              }
            ],
            "pageInfo": {
              "startCursor": "<mock-value-for-field-\\"startCursor\\">"
            }
          },
          "id": "<Feedback-mock-id-5>"
        }
      }
    }
  }
}
`;

exports[`generate mock with multiple spreads 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest13Query {
  viewer {
    ...RelayMockPayloadGeneratorTest13Fragment
  }
}

fragment RelayMockPayloadGeneratorTest13Fragment on Viewer {
  actor {
    __typename
    ... on User {
      id
      name
      traits
      profile_picture {
        uri
        height
      }
    }
    ... on Page {
      id
      name
      websites
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "viewer": {
      "actor": {
        "__typename": "User",
        "id": "<mock-id-1>",
        "name": "<mock-value-for-field-\\"name\\">",
        "traits": "<mock-value-for-field-\\"traits\\">",
        "profile_picture": {
          "uri": "<mock-value-for-field-\\"uri\\">",
          "height": "<mock-value-for-field-\\"height\\">"
        }
      }
    }
  }
}
`;

exports[`should return \`null\` for selection if that is specified in default values 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest19Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest27Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest24Fragment on User {
  id
  name
}

fragment RelayMockPayloadGeneratorTest25Fragment on User {
  id
  name
  profile_picture {
    ...RelayMockPayloadGeneratorTest26Fragment
  }
}

fragment RelayMockPayloadGeneratorTest26Fragment on Image {
  uri
  width
  height
}

fragment RelayMockPayloadGeneratorTest27Fragment on User {
  body {
    text
  }
  actor {
    __typename
    name
    id
  }
  myActor: actor {
    __typename
    ...RelayMockPayloadGeneratorTest24Fragment
    id
  }
  ...RelayMockPayloadGeneratorTest25Fragment
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<mock-id-1>",
      "body": {
        "text": "<mock-value-for-field-\\"text\\">"
      },
      "actor": null,
      "myActor": {
        "__typename": "User",
        "id": "<mock-id-2>",
        "name": "<mock-value-for-field-\\"name\\">"
      },
      "name": "<mock-value-for-field-\\"name\\">",
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">",
        "width": "<mock-value-for-field-\\"width\\">",
        "height": "<mock-value-for-field-\\"height\\">"
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock data with mock resolver for ID that may return \`undefined\` 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest35Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "this-is-my-id",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "<User-mock-id-1>",
              "name": "<mock-value-for-field-\\"name\\">"
            }
          },
          {
            "node": {
              "id": "<User-mock-id-2>",
              "name": "<mock-value-for-field-\\"name\\">"
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock for client extensions 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest43Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock for enum in arrays 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest40Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      traits
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "traits": [
        "CHEERFUL",
        "DERISIVE"
      ]
    }
  }
}
`;

exports[`with @relay_test_operation generate mock for enum with different case should be OK 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest39Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      environment
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "environment": "WEB"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock for simple fragment 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest21Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest28Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest28Fragment on User {
  id
  name
  profile_picture {
    uri
    width
    height
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">",
        "width": 42,
        "height": 42
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock for simple query 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest20Query {
  me {
    id
    name
    emailAddresses
    profile_picture(scale: 1) {
      uri
      width
      height
    }
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "me": {
      "id": "<User-mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "emailAddresses": [
        "<mock-value-for-field-\\"emailAddresses\\">"
      ],
      "profile_picture": {
        "uri": "<mock-value-for-field-\\"uri\\">",
        "width": 42,
        "height": 42
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Enums 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest22Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      name
      environment
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "name": "<mock-value-for-field-\\"name\\">",
      "environment": "WEB"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Mock Resolvers for Concrete Type 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest23Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      name
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "my-id",
      "name": "my-name"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest24Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      name
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "my-id",
      "name": "my-name"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type with Concrete Type mock resolver 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest27Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      name
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "my-user-id",
      "name": "my-user-name"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type with multiple fragment spreads 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest25Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      name
    }
    ... on Page {
      id
      pageName: name
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "Page",
      "id": "my-page-id",
      "pageName": "<mock-value-for-field-\\"pageName\\">"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type with multiple fragments 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest26Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest29Fragment
    ...RelayMockPayloadGeneratorTest30Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest29Fragment on Page {
  id
  pageName: name
}

fragment RelayMockPayloadGeneratorTest30Fragment on User {
  id
  userName: name
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "Page",
      "id": "my-page-id",
      "pageName": "<mock-value-for-field-\\"pageName\\">"
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with Mock Resolvers for Scalar field as null 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest28Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      name
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "my-user-id",
      "name": null
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with default value for object in plural field 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest36Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "<User-mock-id-2>",
              "name": "Alice"
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with default value for plural field and its object 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest37Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "<User-mock-id-2>",
              "name": "Alice"
            }
          },
          {
            "node": {
              "id": "<User-mock-id-3>",
              "name": "Alice"
            }
          },
          {
            "node": {
              "id": "<User-mock-id-4>",
              "name": "Alice"
            }
          },
          {
            "node": {
              "id": "<User-mock-id-5>",
              "name": "Alice"
            }
          },
          {
            "node": {
              "id": "<User-mock-id-6>",
              "name": "Alice"
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with default value for scalar plural field 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest38Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      emailAddresses
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "emailAddresses": [
        "my@email.com"
      ]
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with empty array for scalar field  1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest30Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      emailAddresses
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "emailAddresses": []
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with multiple items in arrays for linked field with custom data 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest33Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
            profile_picture {
              uri
              width
              height
            }
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "friend-id-2",
              "name": "Alice",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          },
          {
            "node": {
              "id": "friend-id-3",
              "name": "Bob",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with multiple items in arrays for linked field with custom data and additional mock resolver 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest34Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
            profile_picture {
              uri
              width
              height
            }
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "<User-mock-id-2>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "/image-url-3.jpg",
                "width": 42,
                "height": 42
              }
            }
          },
          {
            "node": {
              "id": "<User-mock-id-4>",
              "name": "Bob with Image",
              "profile_picture": {
                "uri": "/image-url-5.jpg",
                "width": 42,
                "height": 42
              }
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with multiple items in arrays for linked field with default data 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest31Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
            profile_picture {
              uri
              width
              height
            }
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "friends": {
        "edges": [
          {
            "node": {
              "id": "<User-mock-id-2>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          },
          {
            "node": {
              "id": "<User-mock-id-3>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          },
          {
            "node": {
              "id": "<User-mock-id-4>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          },
          {
            "node": {
              "id": "<User-mock-id-5>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          },
          {
            "node": {
              "id": "<User-mock-id-6>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with multiple items in arrays for scalar field 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest29Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      emailAddresses
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "emailAddresses": [
        "mock_email-0-2@fb.com",
        "mock_email-1-3@fb.com",
        "mock_email-2-4@fb.com",
        "mock_email-3-5@fb.com",
        "mock_email-4-6@fb.com"
      ]
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with multiple items in arrays including null 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest32Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      friends {
        edges {
          node {
            id
            name
            profile_picture {
              uri
              width
              height
            }
          }
        }
      }
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "friends": {
        "edges": [
          null,
          {
            "node": {
              "id": "<User-mock-id-2>",
              "name": "<mock-value-for-field-\\"name\\">",
              "profile_picture": {
                "uri": "<mock-value-for-field-\\"uri\\">",
                "width": 42,
                "height": 42
              }
            }
          }
        ]
      }
    }
  }
}
`;

exports[`with @relay_test_operation generate mock with null for enum 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest42Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
      environment
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "environment": null
    }
  }
}
`;

exports[`with @relay_test_operation should generate data for @match with MarkdownUserNameRenderer_name 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest45Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest31Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
  markdown
  data {
    markup
    id
  }
}

fragment RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name on PlainUserNameRenderer {
  plaintext
  data {
    text
    id
  }
}

fragment RelayMockPayloadGeneratorTest31Fragment on User {
  id
  nameRenderer(supported: ["PlainUserNameRenderer", "MarkdownUserNameRenderer"]) {
    __typename
    ... on PlainUserNameRenderer {
      ...RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name
      __module_operation_RelayMockPayloadGeneratorTest31Fragment: js(module: "RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")
      __module_component_RelayMockPayloadGeneratorTest31Fragment: js(module: "PlainUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")
    }
    ... on MarkdownUserNameRenderer {
      ...RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name
      __module_operation_RelayMockPayloadGeneratorTest31Fragment: js(module: "RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")
      __module_component_RelayMockPayloadGeneratorTest31Fragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")
    }
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "nameRenderer": {
        "__typename": "MarkdownUserNameRenderer",
        "__module_operation_RelayMockPayloadGeneratorTest31Fragment": "RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$normalization",
        "markdown": "<mock-value-for-field-\\"markdown\\">",
        "data": {
          "markup": "<mock-value-for-field-\\"markup\\">",
          "id": "<MarkdownUserNameData-mock-id-2>"
        }
      }
    }
  }
}
`;

exports[`with @relay_test_operation should generate data for @match with PlainUserNameRenderer_name 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest46Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest32Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest32Fragment on User {
  id
  nameRenderer(supported: ["PlainUserNameRenderer", "MarkdownUserNameRenderer"]) {
    __typename
    ... on PlainUserNameRenderer {
      ...RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name
      __module_operation_RelayMockPayloadGeneratorTest32Fragment: js(module: "RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")
      __module_component_RelayMockPayloadGeneratorTest32Fragment: js(module: "PlainUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")
    }
    ... on MarkdownUserNameRenderer {
      ...RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name
      __module_operation_RelayMockPayloadGeneratorTest32Fragment: js(module: "RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")
      __module_component_RelayMockPayloadGeneratorTest32Fragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")
    }
  }
}

fragment RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
  markdown
  data {
    markup
    id
  }
}

fragment RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name on PlainUserNameRenderer {
  plaintext
  data {
    text
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "nameRenderer": {
        "__typename": "PlainUserNameRenderer",
        "__module_operation_RelayMockPayloadGeneratorTest32Fragment": "RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$normalization",
        "plaintext": "<mock-value-for-field-\\"plaintext\\">",
        "data": {
          "text": "<mock-value-for-field-\\"text\\">",
          "id": "<PlainUserNameData-mock-id-2>"
        }
      }
    }
  }
}
`;

exports[`with @relay_test_operation should generate data for @module 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest44Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTestNameRendererFragment
    id
  }
}

fragment RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
  markdown
  data {
    markup
    id
  }
}

fragment RelayMockPayloadGeneratorTestNameRendererFragment on User {
  id
  nameRenderer {
    __typename
    ... on MarkdownUserNameRenderer {
      ...RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name
      __module_operation_RelayMockPayloadGeneratorTestNameRendererFragment: js(module: "RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTestNameRendererFragment.nameRenderer")
      __module_component_RelayMockPayloadGeneratorTestNameRendererFragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTestNameRendererFragment.nameRenderer")
    }
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "nameRenderer": {
        "__typename": "MarkdownUserNameRenderer",
        "__module_operation_RelayMockPayloadGeneratorTestNameRendererFragment": "RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$normalization",
        "markdown": "<mock-value-for-field-\\"markdown\\">",
        "data": {
          "markup": "<mock-value-for-field-\\"markup\\">",
          "id": "<MarkdownUserNameData-mock-id-2>"
        }
      }
    }
  }
}
`;

exports[`with @relay_test_operation should generate data for @module with \`null\` in mock resolvers 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest48Query {
  node(id: "my-id") {
    __typename
    ...RelayMockPayloadGeneratorTest34Fragment
    id
  }
}

fragment RelayMockPayloadGeneratorTest34Fragment on User {
  id
  nameRenderer {
    __typename
    ... on MarkdownUserNameRenderer {
      ...RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name
      __module_operation_RelayMockPayloadGeneratorTest34Fragment: js(module: "RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest34Fragment.nameRenderer")
      __module_component_RelayMockPayloadGeneratorTest34Fragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest34Fragment.nameRenderer")
    }
  }
}

fragment RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
  markdown
  data {
    markup
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "nameRenderer": null
    }
  }
}
`;

exports[`with @relay_test_operation should throw if invalid default value provide for __module_operation. 1`] = `"RelayMockPayloadGenerator(): Unexpected default value for a field \`__module_operation\` in the mock resolver for @module dependency. Provided value is \\"{\\"kind\\":\\"InvalidObject\\"}\\" and we're expecting an object of a type \`NormalizationSplitOperation\`. Please adjust mock resolver for the type \\"MarkdownUserNameRenderer\\". Typically it should require a file \\"RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$normalization.graphql\\"."`;

exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation disabled 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest43Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>"
    }
  }
}
`;

exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation enabled 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query RelayMockPayloadGeneratorTest43Query {
  node(id: "my-id") {
    __typename
    ... on User {
      id
    }
    id
  }
}

~~~~~~~~~~ OUTPUT ~~~~~~~~~~
{
  "data": {
    "node": {
      "__typename": "User",
      "id": "<Node-mock-id-1>",
      "client_name": "<mock-value-for-field-\\"client_name\\">",
      "client_code": 42
    }
  }
}
`;

<MSG> adding support for client extensions in mock payload generator (#4030)

Summary:
## Problem
At Twitter we've been hoping to use MockPayloadGenerator to allow us to scaffold data in tests/[stories](https://storybook.js.org/) while our components use client side schema extensions. One of the engineers on my team discovered that this support is explicitly disallowed in the `relay` repo. I reached out to the discord channel and received feedback that enabling this would make sense.

## Solution
Within `RelayMockPayloadGenerator.js`, modify the logic within `_traverseSelections` to recursively traverse the nested selections. This places the logic alongside `DEFER` and `STREAM`.

A snapshot was updated as a result of this change —  local client extension `client_name` and `client_code` now have generated mocked fields.

Pull Request resolved: https://github.com/facebook/relay/pull/4030

Reviewed By: josephsavona

Differential Revision: D38659517

Pulled By: voideanvalue

fbshipit-source-id: 77e5d5cc7abce644830eb632f95b128534f57abf

<DFF> @@ -1137,29 +1137,6 @@ query RelayMockPayloadGeneratorTest35Query {
 }
 `;
 
-exports[`with @relay_test_operation generate mock for client extensions 1`] = `
-~~~~~~~~~~ INPUT ~~~~~~~~~~
-query RelayMockPayloadGeneratorTest43Query {
-  node(id: "my-id") {
-    __typename
-    ... on User {
-      id
-    }
-    id
-  }
-}
-
-~~~~~~~~~~ OUTPUT ~~~~~~~~~~
-{
-  "data": {
-    "node": {
-      "__typename": "User",
-      "id": "<Node-mock-id-1>"
-    }
-  }
-}
-`;
-
 exports[`with @relay_test_operation generate mock for enum in arrays 1`] = `
 ~~~~~~~~~~ INPUT ~~~~~~~~~~
 query RelayMockPayloadGeneratorTest40Query {
@@ -2177,3 +2154,51 @@ fragment RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name on Markdown
 `;
 
 exports[`with @relay_test_operation should throw if invalid default value provide for __module_operation. 1`] = `"RelayMockPayloadGenerator(): Unexpected default value for a field \`__module_operation\` in the mock resolver for @module dependency. Provided value is \\"{\\"kind\\":\\"InvalidObject\\"}\\" and we're expecting an object of a type \`NormalizationSplitOperation\`. Please adjust mock resolver for the type \\"MarkdownUserNameRenderer\\". Typically it should require a file \\"RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$normalization.graphql\\"."`;
+
+exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation disabled 1`] = `
+~~~~~~~~~~ INPUT ~~~~~~~~~~
+query RelayMockPayloadGeneratorTest43Query {
+  node(id: "my-id") {
+    __typename
+    ... on User {
+      id
+    }
+    id
+  }
+}
+
+~~~~~~~~~~ OUTPUT ~~~~~~~~~~
+{
+  "data": {
+    "node": {
+      "__typename": "User",
+      "id": "<Node-mock-id-1>"
+    }
+  }
+}
+`;
+
+exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation enabled 1`] = `
+~~~~~~~~~~ INPUT ~~~~~~~~~~
+query RelayMockPayloadGeneratorTest43Query {
+  node(id: "my-id") {
+    __typename
+    ... on User {
+      id
+    }
+    id
+  }
+}
+
+~~~~~~~~~~ OUTPUT ~~~~~~~~~~
+{
+  "data": {
+    "node": {
+      "__typename": "User",
+      "id": "<Node-mock-id-1>",
+      "client_name": "<mock-value-for-field-\\"client_name\\">",
+      "client_code": "<mock-value-for-field-\\"client_code\\">"
+    }
+  }
+}
+`;

{'commit': 'diff --git a/packages/relay-test-utils/RelayMockPayloadGenerator.js b/packages/relay-test-utils/RelayMockPayloadGenerator.js\nindex b3b92380bc88..f34502562ab3 100644\n--- a/packages/relay-test-utils/RelayMockPayloadGenerator.js\n+++ b/packages/relay-test-utils/RelayMockPayloadGenerator.js\n@@ -178,11 +178,13 @@ class RelayMockPayloadGenerator {\n   _resolveValue: ValueResolver;\n   _mockResolvers: MockResolvers;\n   _selectionMetadata: SelectionMetadata;\n+  _mockClientData: boolean;\n \n   constructor(options: {\n     +variables: Variables,\n     +mockResolvers: MockResolvers | null,\n     +selectionMetadata: SelectionMetadata | null,\n+    +mockClientData: ?boolean,\n   }) {\n     this._variables = options.variables;\n     // $FlowFixMe[cannot-spread-inexact]\n@@ -194,6 +196,7 @@ class RelayMockPayloadGenerator {\n     this._selectionMetadata = options.selectionMetadata ?? {};\n     // $FlowFixMe[incompatible-call]\n     this._resolveValue = createValueResolver(this._mockResolvers);\n+    this._mockClientData = options.mockClientData ?? false;\n   }\n \n   generate(\n@@ -295,6 +298,11 @@ class RelayMockPayloadGenerator {\n           }\n           break;\n \n+        case CLIENT_EXTENSION:\n+          if (!this._mockClientData) {\n+            break;\n+          }\n+        // falls through\n         case DEFER:\n         case STREAM: {\n           mockData = this._traverseSelections(\n@@ -480,10 +488,6 @@ class RelayMockPayloadGenerator {\n             };\n           }\n           break;\n-        case CLIENT_EXTENSION:\n-          // We do not expect to receive data for the client extensions\n-          // from the server. MockPayloadGenerator should not generate it too.\n-          break;\n         case TYPE_DISCRIMINATOR:\n           const {abstractKey} = selection;\n           if (mockData != null) {\n@@ -854,11 +858,13 @@ function generateData(\n   variables: Variables,\n   mockResolvers: MockResolvers | null,\n   selectionMetadata: SelectionMetadata | null,\n+  options: ?{mockClientData?: boolean},\n ): MockData {\n   const mockGenerator = new RelayMockPayloadGenerator({\n     variables,\n     mockResolvers,\n     selectionMetadata,\n+    mockClientData: options?.mockClientData,\n   });\n   let operationType;\n   if (node.name.endsWith(\'Mutation\')) {\n@@ -913,12 +919,14 @@ function getSelectionMetadataFromOperation(\n function generateDataForOperation(\n   operation: OperationDescriptor,\n   mockResolvers: ?MockResolvers,\n+  options: ?{mockClientData?: boolean},\n ): GraphQLSingularResponse {\n   const data = generateData(\n     operation.request.node.operation,\n     operation.request.variables,\n     mockResolvers ?? null,\n     getSelectionMetadataFromOperation(operation),\n+    options,\n   );\n   return {data};\n }\ndiff --git a/packages/relay-test-utils/__tests__/RelayMockPayloadGenerator-test.js b/packages/relay-test-utils/__tests__/RelayMockPayloadGenerator-test.js\nindex 26dfddc1c0ec..e1603717a66d 100644\n--- a/packages/relay-test-utils/__tests__/RelayMockPayloadGenerator-test.js\n+++ b/packages/relay-test-utils/__tests__/RelayMockPayloadGenerator-test.js\n@@ -21,9 +21,14 @@ const {FIXTURE_TAG} = require(\'relay-test-utils-internal\');\n function testGeneratedData<TVariables: Variables, TData, TRawResponse>(\n   query: Query<TVariables, TData, TRawResponse>,\n   mockResolvers: ?MockResolvers,\n+  options: ?{mockClientData?: boolean},\n ): void {\n   const operation = createOperationDescriptor(query, {});\n-  const payload = RelayMockPayloadGenerator.generate(operation, mockResolvers);\n+  const payload = RelayMockPayloadGenerator.generate(\n+    operation,\n+    mockResolvers,\n+    options,\n+  );\n \n   expect({\n     [FIXTURE_TAG]: true,\n@@ -1432,22 +1437,6 @@ describe(\'with @relay_test_operation\', () => {\n     );\n   });\n \n-  test(\'generate mock for client extensions\', () => {\n-    testGeneratedData(\n-      graphql`\n-        query RelayMockPayloadGeneratorTest43Query @relay_test_operation {\n-          node(id: "my-id") {\n-            ... on User {\n-              id\n-              client_name\n-              client_code\n-            }\n-          }\n-        }\n-      `,\n-    );\n-  });\n-\n   test(\'should generate data for @module\', () => {\n     graphql`\n       fragment RelayMockPayloadGeneratorTestNameRendererFragment on User {\n@@ -1653,4 +1642,29 @@ describe(\'with @relay_test_operation\', () => {\n       },\n     );\n   });\n+\n+  describe(\'with client extensions\', () => {\n+    const clientExtensionsQuery = graphql`\n+      query RelayMockPayloadGeneratorTest43Query @relay_test_operation {\n+        node(id: "my-id") {\n+          ... on User {\n+            id\n+            client_name\n+            client_code\n+          }\n+        }\n+      }\n+    `;\n+    test(\'generate mock for client extensions with client generation disabled\', () => {\n+      testGeneratedData(clientExtensionsQuery, undefined, {\n+        mockClientData: false,\n+      });\n+    });\n+\n+    test(\'generate mock for client extensions with client generation enabled\', () => {\n+      testGeneratedData(clientExtensionsQuery, undefined, {\n+        mockClientData: true,\n+      });\n+    });\n+  });\n });\ndiff --git a/packages/relay-test-utils/__tests__/__snapshots__/RelayMockPayloadGenerator-test.js.snap b/packages/relay-test-utils/__tests__/__snapshots__/RelayMockPayloadGenerator-test.js.snap\nindex d58eda11c87d..fd61c6b582a2 100644\n--- a/packages/relay-test-utils/__tests__/__snapshots__/RelayMockPayloadGenerator-test.js.snap\n+++ b/packages/relay-test-utils/__tests__/__snapshots__/RelayMockPayloadGenerator-test.js.snap\n@@ -1137,29 +1137,6 @@ query RelayMockPayloadGeneratorTest35Query {\n }\n `;\n \n-exports[`with @relay_test_operation generate mock for client extensions 1`] = `\n-~~~~~~~~~~ INPUT ~~~~~~~~~~\n-query RelayMockPayloadGeneratorTest43Query {\n-  node(id: "my-id") {\n-    __typename\n-    ... on User {\n-      id\n-    }\n-    id\n-  }\n-}\n-\n-~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n-{\n-  "data": {\n-    "node": {\n-      "__typename": "User",\n-      "id": "<Node-mock-id-1>"\n-    }\n-  }\n-}\n-`;\n-\n exports[`with @relay_test_operation generate mock for enum in arrays 1`] = `\n ~~~~~~~~~~ INPUT ~~~~~~~~~~\n query RelayMockPayloadGeneratorTest40Query {\n@@ -2177,3 +2154,51 @@ fragment RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name on Markdown\n `;\n \n exports[`with @relay_test_operation should throw if invalid default value provide for __module_operation. 1`] = `"RelayMockPayloadGenerator(): Unexpected default value for a field \\`__module_operation\\` in the mock resolver for @module dependency. Provided value is \\\\"{\\\\"kind\\\\":\\\\"InvalidObject\\\\"}\\\\" and we\'re expecting an object of a type \\`NormalizationSplitOperation\\`. Please adjust mock resolver for the type \\\\"MarkdownUserNameRenderer\\\\". Typically it should require a file \\\\"RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$normalization.graphql\\\\"."`;\n+\n+exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation disabled 1`] = `\n+~~~~~~~~~~ INPUT ~~~~~~~~~~\n+query RelayMockPayloadGeneratorTest43Query {\n+  node(id: "my-id") {\n+    __typename\n+    ... on User {\n+      id\n+    }\n+    id\n+  }\n+}\n+\n+~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n+{\n+  "data": {\n+    "node": {\n+      "__typename": "User",\n+      "id": "<Node-mock-id-1>"\n+    }\n+  }\n+}\n+`;\n+\n+exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation enabled 1`] = `\n+~~~~~~~~~~ INPUT ~~~~~~~~~~\n+query RelayMockPayloadGeneratorTest43Query {\n+  node(id: "my-id") {\n+    __typename\n+    ... on User {\n+      id\n+    }\n+    id\n+  }\n+}\n+\n+~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n+{\n+  "data": {\n+    "node": {\n+      "__typename": "User",\n+      "id": "<Node-mock-id-1>",\n+      "client_name": "<mock-value-for-field-\\\\"client_name\\\\">",\n+      "client_code": "<mock-value-for-field-\\\\"client_code\\\\">"\n+    }\n+  }\n+}\n+`;\n', 'commit_subject': 'adding support for client extensions in mock payload generator (#4030)', 'repo_name': 'facebook/relay', 'committer': {'name': 'Facebook GitHub Bot', 'email': 'f08905f3496a7b7d60e0da97307f6ad7594abc92@users.noreply.github.com', 'time_sec': '1660776374', 'tz_offset': '-420', 'date': {'seconds': '1660776374'}}, 'commit_tree': '5f975d3af7f30418f7b84dcc1cb3df6cc64558af', 'commit_message': "adding support for client extensions in mock payload generator (#4030)\n\nSummary:\n## Problem\nAt Twitter we've been hoping to use MockPayloadGenerator to allow us to scaffold data in tests/[stories](https://storybook.js.org/) while our components use client side schema extensions. One of the engineers on my team discovered that this support is explicitly disallowed in the `relay` repo. I reached out to the discord channel and received feedback that enabling this would make sense.\n\n## Solution\nWithin `RelayMockPayloadGenerator.js`, modify the logic within `_traverseSelections` to recursively traverse the nested selections. This places the logic alongside `DEFER` and `STREAM`.\n\nA snapshot was updated as a result of this change —  local client extension `client_name` and `client_code` now have generated mocked fields.\n\nPull Request resolved: https://github.com/facebook/relay/pull/4030\n\nReviewed By: josephsavona\n\nDifferential Revision: D38659517\n\nPulled By: voideanvalue\n\nfbshipit-source-id: 77e5d5cc7abce644830eb632f95b128534f57abf\n", 'language_name': 'JavaScript', 'license': 'mit', 'hunks': '@@ -1137,29 +1137,6 @@ query RelayMockPayloadGeneratorTest35Query {\n }\n `;\n \n-exports[`with @relay_test_operation generate mock for client extensions 1`] = `\n-~~~~~~~~~~ INPUT ~~~~~~~~~~\n-query RelayMockPayloadGeneratorTest43Query {\n-  node(id: "my-id") {\n-    __typename\n-    ... on User {\n-      id\n-    }\n-    id\n-  }\n-}\n-\n-~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n-{\n-  "data": {\n-    "node": {\n-      "__typename": "User",\n-      "id": "<Node-mock-id-1>"\n-    }\n-  }\n-}\n-`;\n-\n exports[`with @relay_test_operation generate mock for enum in arrays 1`] = `\n ~~~~~~~~~~ INPUT ~~~~~~~~~~\n query RelayMockPayloadGeneratorTest40Query {\n@@ -2177,3 +2154,51 @@ fragment RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name on Markdown\n `;\n \n exports[`with @relay_test_operation should throw if invalid default value provide for __module_operation. 1`] = `"RelayMockPayloadGenerator(): Unexpected default value for a field \\`__module_operation\\` in the mock resolver for @module dependency. Provided value is \\\\"{\\\\"kind\\\\":\\\\"InvalidObject\\\\"}\\\\" and we\'re expecting an object of a type \\`NormalizationSplitOperation\\`. Please adjust mock resolver for the type \\\\"MarkdownUserNameRenderer\\\\". Typically it should require a file \\\\"RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$normalization.graphql\\\\"."`;\n+\n+exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation disabled 1`] = `\n+~~~~~~~~~~ INPUT ~~~~~~~~~~\n+query RelayMockPayloadGeneratorTest43Query {\n+  node(id: "my-id") {\n+    __typename\n+    ... on User {\n+      id\n+    }\n+    id\n+  }\n+}\n+\n+~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n+{\n+  "data": {\n+    "node": {\n+      "__typename": "User",\n+      "id": "<Node-mock-id-1>"\n+    }\n+  }\n+}\n+`;\n+\n+exports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation enabled 1`] = `\n+~~~~~~~~~~ INPUT ~~~~~~~~~~\n+query RelayMockPayloadGeneratorTest43Query {\n+  node(id: "my-id") {\n+    __typename\n+    ... on User {\n+      id\n+    }\n+    id\n+  }\n+}\n+\n+~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n+{\n+  "data": {\n+    "node": {\n+      "__typename": "User",\n+      "id": "<Node-mock-id-1>",\n+      "client_name": "<mock-value-for-field-\\\\"client_name\\\\">",\n+      "client_code": "<mock-value-for-field-\\\\"client_code\\\\">"\n+    }\n+  }\n+}\n+`;\n', 'addition_count': 48, 'deletion_count': 23, 'src_file': 'a/packages/relay-test-utils/__tests__/__snapshots__/RelayMockPayloadGenerator-test.js.snap', 'tgt_file': 'b/packages/relay-test-utils/__tests__/__snapshots__/RelayMockPayloadGenerator-test.js.snap', 'file_extension': '.snap', 'before_file': '// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`check context in the mock resolver 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest11Query {\n  viewer {\n    ...RelayMockPayloadGeneratorTest11Fragment\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest11Fragment on Viewer {\n  actor {\n    __typename\n    ... on User {\n      id\n      name\n      profile_picture {\n        uri\n        height\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "viewer": {\n      "actor": {\n        "__typename": "User",\n        "id": "<mock-id-1>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "profile_picture": {\n          "uri": "http://my-image",\n          "height": 100\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`generate basic mock data 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest6Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest6Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest6Fragment on User {\n  id\n  name\n  author {\n    id\n    name\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "author": {\n        "id": "<User-mock-id-2>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock and verify arguments in the context 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest14Query(\n  $smallScale: Float = 1\n  $bigScale: Float = 100\n) {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest14Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest14Fragment on User {\n  id\n  name\n  smallImage: profile_picture(scale: $smallScale) {\n    uri\n  }\n  bigImage: profile_picture(scale: $bigScale) {\n    uri\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "smallImage": {\n        "uri": "small image"\n      },\n      "bigImage": {\n        "uri": "big image"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock for fragment with @argumentsDefinition 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest15Query(\n  $scale: Float = 1\n) {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest15Fragment_3I1js\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest15Fragment_3I1js on User {\n  id\n  name\n  profile_picture(scale: $scale) {\n    uri\n    width\n    height\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n        "width": 42,\n        "height": 42\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock for multiple fragment spreads 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest17Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest20Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest17Fragment on Page {\n  id\n  pageName: name\n}\n\nfragment RelayMockPayloadGeneratorTest18Fragment on User {\n  id\n  name\n  username\n}\n\nfragment RelayMockPayloadGeneratorTest19Fragment on User {\n  ...RelayMockPayloadGeneratorTest18Fragment\n  profile_picture {\n    uri\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest20Fragment on User {\n  body {\n    text\n  }\n  actor {\n    __typename\n    name\n    id\n  }\n  myActor: actor {\n    __typename\n    ...RelayMockPayloadGeneratorTest17Fragment\n    id\n  }\n  ...RelayMockPayloadGeneratorTest18Fragment\n  ...RelayMockPayloadGeneratorTest19Fragment\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "body": {\n        "text": "<mock-value-for-field-\\\\"text\\\\">"\n      },\n      "actor": {\n        "__typename": "__MockObject",\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "id": "<mock-id-2>"\n      },\n      "myActor": {\n        "__typename": "Page",\n        "id": "<mock-id-3>",\n        "pageName": "<mock-value-for-field-\\\\"pageName\\\\">"\n      },\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "username": "<mock-value-for-field-\\\\"username\\\\">",\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock for objects without concrete type 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest9Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest9Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest9Fragment on Page {\n  actor {\n    __typename\n    id\n    name\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "Page",\n      "actor": {\n        "__typename": "__MockObject",\n        "id": "<mock-id-1>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">"\n      },\n      "id": "<mock-id-2>"\n    }\n  }\n}\n`;\n\nexports[`generate mock for plural fragment 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest16Query {\n  nodes {\n    __typename\n    ...RelayMockPayloadGeneratorTest16Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest16Fragment on Comment {\n  id\n  body {\n    text\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "nodes": [\n      {\n        "__typename": "Comment",\n        "id": "<mock-id-1>",\n        "body": {\n          "text": "<mock-value-for-field-\\\\"text\\\\">"\n        }\n      }\n    ]\n  }\n}\n`;\n\nexports[`generate mock for simple fragment 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest1Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTestFragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTestFragment on User {\n  id\n  name\n  profile_picture {\n    uri\n    width\n    height\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n        "width": "<mock-value-for-field-\\\\"width\\\\">",\n        "height": "<mock-value-for-field-\\\\"height\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock for with directives and handlers 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest18Query(\n  $first: Int = 10\n  $picturePreset: PhotoSize\n  $RELAY_INCREMENTAL_DELIVERY: Boolean = false\n) {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest22Fragment_1t4y1N\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest21Fragment on User {\n  birthdate {\n    month\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest22Fragment_1t4y1N on User {\n  id\n  name\n  myActor: actor {\n    __typename\n    id\n    name\n  }\n  customName: name\n  friends(first: $first) {\n    edges {\n      node {\n        id\n        name\n        __typename\n      }\n      cursor\n    }\n    myPageInfo: pageInfo {\n      endCursor\n      hasNextPage\n    }\n    pageInfo {\n      endCursor\n      hasNextPage\n    }\n  }\n  profile_picture {\n    uri\n  }\n  profilePicture(preset: $picturePreset) {\n    uri\n  }\n  ...RelayMockPayloadGeneratorTest21Fragment\n  actor {\n    __typename\n    ... on User {\n      id\n      userName: name\n      name: username\n      profilePicture(size: 1) {\n        uri\n        width\n        height\n      }\n      feedback {\n        comments {\n          edges {\n            node {\n              ...RelayMockPayloadGeneratorTest23Fragment @defer(label: "RelayMockPayloadGeneratorTest22Fragment$defer$DeferLabel", if: $RELAY_INCREMENTAL_DELIVERY)\n              id\n            }\n          }\n        }\n        id\n      }\n    }\n    ... on Page {\n      id\n      pageName: name\n    }\n    username\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest23Fragment on Comment {\n  body {\n    text\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "myActor": {\n        "__typename": "__MockObject",\n        "id": "<mock-id-2>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">"\n      },\n      "customName": "<mock-value-for-field-\\\\"customName\\\\">",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "<User-mock-id-3>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "__typename": "User"\n            },\n            "cursor": "<mock-value-for-field-\\\\"cursor\\\\">"\n          }\n        ],\n        "myPageInfo": {\n          "endCursor": "<mock-value-for-field-\\\\"endCursor\\\\">",\n          "hasNextPage": "<mock-value-for-field-\\\\"hasNextPage\\\\">"\n        },\n        "pageInfo": {\n          "endCursor": "<mock-value-for-field-\\\\"endCursor\\\\">",\n          "hasNextPage": "<mock-value-for-field-\\\\"hasNextPage\\\\">"\n        }\n      },\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">"\n      },\n      "profilePicture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">"\n      },\n      "birthdate": {\n        "month": "<mock-value-for-field-\\\\"month\\\\">"\n      },\n      "actor": {\n        "__typename": "User",\n        "username": "<mock-value-for-field-\\\\"username\\\\">",\n        "id": "<mock-id-4>",\n        "userName": "<mock-value-for-field-\\\\"userName\\\\">",\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "profilePicture": {\n          "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n          "width": "<mock-value-for-field-\\\\"width\\\\">",\n          "height": "<mock-value-for-field-\\\\"height\\\\">"\n        },\n        "feedback": {\n          "comments": {\n            "edges": [\n              {\n                "node": {\n                  "body": {\n                    "text": "<mock-value-for-field-\\\\"text\\\\">"\n                  },\n                  "id": "<Comment-mock-id-5>"\n                }\n              }\n            ]\n          },\n          "id": "<Feedback-mock-id-6>"\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock using custom mock functions 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest7Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest7Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest7Fragment on User {\n  id\n  name\n  profile_picture {\n    uri\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "my-id-1001",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "profile_picture": {\n        "uri": "http://my-uri"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock using custom mock functions for object type (multiple object) 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest10Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest10Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest10Fragment on User {\n  name\n  actor {\n    __typename\n    ... on User {\n      id\n      name\n      profile_picture {\n        uri\n        height\n      }\n    }\n    id\n  }\n  profile_picture {\n    uri\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "My user name",\n      "actor": {\n        "__typename": "User",\n        "id": "<mock-id-2>",\n        "name": "My user name",\n        "profile_picture": {\n          "uri": "http://my-image",\n          "height": 100\n        }\n      },\n      "profile_picture": {\n        "uri": "http://my-image"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock using custom mock functions for object type 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest8Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest8Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest8Fragment on Page {\n  actor {\n    __typename\n    id\n    name\n  }\n  backgroundImage {\n    width\n    uri\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "Page",\n      "actor": {\n        "__typename": "__MockObject",\n        "id": "<mock-id-1>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">"\n      },\n      "backgroundImage": {\n        "width": 200,\n        "uri": "http://my-image"\n      },\n      "id": "<mock-id-2>"\n    }\n  }\n}\n`;\n\nexports[`generate mock with abstract inline fragment 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest2Query {\n  viewer {\n    actor {\n      __typename\n      ...RelayMockPayloadGeneratorTest1Fragment\n      id\n    }\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest1Fragment on Actor {\n  __isActor: __typename\n  id\n  ... on Named {\n    __isNamed: __typename\n    name\n  }\n  ... on User {\n    firstName\n    lastName\n  }\n  ... on Page {\n    websites\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "viewer": {\n      "actor": {\n        "__typename": "User",\n        "__isActor": true,\n        "id": "<mock-id-1>",\n        "__isNamed": true,\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "firstName": "<mock-value-for-field-\\\\"firstName\\\\">",\n        "lastName": "<mock-value-for-field-\\\\"lastName\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock with condition (and other complications) 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest4Query(\n  $showProfilePicture: Boolean!\n  $hideBirthday: Boolean!\n  $showBirthdayMonth: Boolean!\n  $hideAuthorUsername: Boolean!\n) {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest3Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest3Fragment on User {\n  id\n  name\n  customId: id\n  profile_picture @include(if: $showProfilePicture) {\n    uri\n  }\n  birthdate @skip(if: $hideBirthday) {\n    year\n    month @include(if: $showBirthdayMonth)\n  }\n  author {\n    name\n    id\n  }\n  author @skip(if: $hideAuthorUsername) {\n    authorID: id\n    objectType: __typename\n    username\n    id\n  }\n  allPhones {\n    phoneNumber {\n      displayNumber\n    }\n  }\n  emailAddresses\n  backgroundImage {\n    uri\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "customId": "<User-mock-id-2>",\n      "author": {\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "id": "<User-mock-id-3>"\n      },\n      "allPhones": [\n        {\n          "phoneNumber": {\n            "displayNumber": "<mock-value-for-field-\\\\"displayNumber\\\\">"\n          }\n        }\n      ],\n      "emailAddresses": "<mock-value-for-field-\\\\"emailAddresses\\\\">",\n      "backgroundImage": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock with connection 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest5Query(\n  $first: Int\n  $skipUserInConnection: Boolean!\n) {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest5Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest4Fragment on User {\n  name\n  username\n  emailAddresses\n}\n\nfragment RelayMockPayloadGeneratorTest5Fragment on Page {\n  actor {\n    __typename\n    ... on User {\n      id\n      myType: __typename\n      myName: name\n      name\n      friends(first: $first) {\n        edges {\n          cursor\n          node {\n            id\n            ...RelayMockPayloadGeneratorTest4Fragment @skip(if: $skipUserInConnection)\n            __typename\n          }\n        }\n        pageInfo {\n          endCursor\n          hasNextPage\n        }\n      }\n      ...RelayMockPayloadGeneratorTest4Fragment\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "Page",\n      "id": "<mock-id-1>",\n      "actor": {\n        "__typename": "User",\n        "id": "<mock-id-2>",\n        "myType": "User",\n        "myName": "<mock-value-for-field-\\\\"myName\\\\">",\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "friends": {\n          "edges": [\n            {\n              "cursor": "<mock-value-for-field-\\\\"cursor\\\\">",\n              "node": {\n                "id": "<User-mock-id-3>",\n                "__typename": "User"\n              }\n            }\n          ],\n          "pageInfo": {\n            "endCursor": "<mock-value-for-field-\\\\"endCursor\\\\">",\n            "hasNextPage": "<mock-value-for-field-\\\\"hasNextPage\\\\">"\n          }\n        },\n        "username": "<mock-value-for-field-\\\\"username\\\\">",\n        "emailAddresses": "<mock-value-for-field-\\\\"emailAddresses\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock with inline fragment 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest3Query(\n  $condition: Boolean!\n) {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest2Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest2Fragment on User {\n  id\n  name\n  author {\n    id\n    name\n    authorID: id\n    username\n  }\n  author @include(if: $condition) {\n    myId: id\n    myUsername: username\n    emailAddresses\n    birthdate {\n      day\n      month\n      year\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "author": {\n        "id": "<User-mock-id-2>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "authorID": "<User-mock-id-3>",\n        "username": "<mock-value-for-field-\\\\"username\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock with manual mock for objects 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest12Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest12Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest12Fragment on Page {\n  id\n  name\n  body {\n    text\n  }\n  myTown: hometown {\n    id\n    name\n    url\n    feedback {\n      comments(first: 10) {\n        edges {\n          cursor\n          comment: node {\n            id\n            message {\n              text\n            }\n            likeSentence {\n              text\n            }\n          }\n        }\n        pageInfo {\n          startCursor\n        }\n      }\n      id\n    }\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "Page",\n      "id": "page-id-2",\n      "name": "My Page",\n      "body": {\n        "text": "My Text"\n      },\n      "myTown": {\n        "id": "page-id-3",\n        "name": "My Hometown",\n        "url": "http://node-myTown",\n        "feedback": {\n          "comments": {\n            "edges": [\n              {\n                "cursor": "<mock-value-for-field-\\\\"cursor\\\\">",\n                "comment": {\n                  "id": "<Comment-mock-id-4>",\n                  "message": {\n                    "text": "Comment text: node>myTown>feedback>comments>edges>comment"\n                  },\n                  "likeSentence": {\n                    "text": "<mock-value-for-field-\\\\"text\\\\">"\n                  }\n                }\n              }\n            ],\n            "pageInfo": {\n              "startCursor": "<mock-value-for-field-\\\\"startCursor\\\\">"\n            }\n          },\n          "id": "<Feedback-mock-id-5>"\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`generate mock with multiple spreads 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest13Query {\n  viewer {\n    ...RelayMockPayloadGeneratorTest13Fragment\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest13Fragment on Viewer {\n  actor {\n    __typename\n    ... on User {\n      id\n      name\n      traits\n      profile_picture {\n        uri\n        height\n      }\n    }\n    ... on Page {\n      id\n      name\n      websites\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "viewer": {\n      "actor": {\n        "__typename": "User",\n        "id": "<mock-id-1>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">",\n        "traits": "<mock-value-for-field-\\\\"traits\\\\">",\n        "profile_picture": {\n          "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n          "height": "<mock-value-for-field-\\\\"height\\\\">"\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`should return \\`null\\` for selection if that is specified in default values 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest19Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest27Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest24Fragment on User {\n  id\n  name\n}\n\nfragment RelayMockPayloadGeneratorTest25Fragment on User {\n  id\n  name\n  profile_picture {\n    ...RelayMockPayloadGeneratorTest26Fragment\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest26Fragment on Image {\n  uri\n  width\n  height\n}\n\nfragment RelayMockPayloadGeneratorTest27Fragment on User {\n  body {\n    text\n  }\n  actor {\n    __typename\n    name\n    id\n  }\n  myActor: actor {\n    __typename\n    ...RelayMockPayloadGeneratorTest24Fragment\n    id\n  }\n  ...RelayMockPayloadGeneratorTest25Fragment\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<mock-id-1>",\n      "body": {\n        "text": "<mock-value-for-field-\\\\"text\\\\">"\n      },\n      "actor": null,\n      "myActor": {\n        "__typename": "User",\n        "id": "<mock-id-2>",\n        "name": "<mock-value-for-field-\\\\"name\\\\">"\n      },\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n        "width": "<mock-value-for-field-\\\\"width\\\\">",\n        "height": "<mock-value-for-field-\\\\"height\\\\">"\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock data with mock resolver for ID that may return \\`undefined\\` 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest35Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "this-is-my-id",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "<User-mock-id-1>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">"\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-2>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">"\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock for client extensions 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest43Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock for enum in arrays 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest40Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      traits\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "traits": [\n        "CHEERFUL",\n        "DERISIVE"\n      ]\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock for enum with different case should be OK 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest39Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      environment\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "environment": "WEB"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock for simple fragment 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest21Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest28Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest28Fragment on User {\n  id\n  name\n  profile_picture {\n    uri\n    width\n    height\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n        "width": 42,\n        "height": 42\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock for simple query 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest20Query {\n  me {\n    id\n    name\n    emailAddresses\n    profile_picture(scale: 1) {\n      uri\n      width\n      height\n    }\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "me": {\n      "id": "<User-mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "emailAddresses": [\n        "<mock-value-for-field-\\\\"emailAddresses\\\\">"\n      ],\n      "profile_picture": {\n        "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n        "width": 42,\n        "height": 42\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Enums 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest22Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      name\n      environment\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "name": "<mock-value-for-field-\\\\"name\\\\">",\n      "environment": "WEB"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Mock Resolvers for Concrete Type 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest23Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      name\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "my-id",\n      "name": "my-name"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest24Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      name\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "my-id",\n      "name": "my-name"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type with Concrete Type mock resolver 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest27Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      name\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "my-user-id",\n      "name": "my-user-name"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type with multiple fragment spreads 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest25Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      name\n    }\n    ... on Page {\n      id\n      pageName: name\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "Page",\n      "id": "my-page-id",\n      "pageName": "<mock-value-for-field-\\\\"pageName\\\\">"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Mock Resolvers for Interface Type with multiple fragments 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest26Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest29Fragment\n    ...RelayMockPayloadGeneratorTest30Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest29Fragment on Page {\n  id\n  pageName: name\n}\n\nfragment RelayMockPayloadGeneratorTest30Fragment on User {\n  id\n  userName: name\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "Page",\n      "id": "my-page-id",\n      "pageName": "<mock-value-for-field-\\\\"pageName\\\\">"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with Mock Resolvers for Scalar field as null 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest28Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      name\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "my-user-id",\n      "name": null\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with default value for object in plural field 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest36Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "<User-mock-id-2>",\n              "name": "Alice"\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with default value for plural field and its object 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest37Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "<User-mock-id-2>",\n              "name": "Alice"\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-3>",\n              "name": "Alice"\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-4>",\n              "name": "Alice"\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-5>",\n              "name": "Alice"\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-6>",\n              "name": "Alice"\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with default value for scalar plural field 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest38Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      emailAddresses\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "emailAddresses": [\n        "my@email.com"\n      ]\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with empty array for scalar field  1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest30Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      emailAddresses\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "emailAddresses": []\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with multiple items in arrays for linked field with custom data 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest33Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n            profile_picture {\n              uri\n              width\n              height\n            }\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "friend-id-2",\n              "name": "Alice",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          },\n          {\n            "node": {\n              "id": "friend-id-3",\n              "name": "Bob",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with multiple items in arrays for linked field with custom data and additional mock resolver 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest34Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n            profile_picture {\n              uri\n              width\n              height\n            }\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "<User-mock-id-2>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "/image-url-3.jpg",\n                "width": 42,\n                "height": 42\n              }\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-4>",\n              "name": "Bob with Image",\n              "profile_picture": {\n                "uri": "/image-url-5.jpg",\n                "width": 42,\n                "height": 42\n              }\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with multiple items in arrays for linked field with default data 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest31Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n            profile_picture {\n              uri\n              width\n              height\n            }\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "friends": {\n        "edges": [\n          {\n            "node": {\n              "id": "<User-mock-id-2>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-3>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-4>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-5>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          },\n          {\n            "node": {\n              "id": "<User-mock-id-6>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with multiple items in arrays for scalar field 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest29Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      emailAddresses\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "emailAddresses": [\n        "mock_email-0-2@fb.com",\n        "mock_email-1-3@fb.com",\n        "mock_email-2-4@fb.com",\n        "mock_email-3-5@fb.com",\n        "mock_email-4-6@fb.com"\n      ]\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with multiple items in arrays including null 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest32Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      friends {\n        edges {\n          node {\n            id\n            name\n            profile_picture {\n              uri\n              width\n              height\n            }\n          }\n        }\n      }\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "friends": {\n        "edges": [\n          null,\n          {\n            "node": {\n              "id": "<User-mock-id-2>",\n              "name": "<mock-value-for-field-\\\\"name\\\\">",\n              "profile_picture": {\n                "uri": "<mock-value-for-field-\\\\"uri\\\\">",\n                "width": 42,\n                "height": 42\n              }\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation generate mock with null for enum 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest42Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n      environment\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "environment": null\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation should generate data for @match with MarkdownUserNameRenderer_name 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest45Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest31Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {\n  markdown\n  data {\n    markup\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name on PlainUserNameRenderer {\n  plaintext\n  data {\n    text\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest31Fragment on User {\n  id\n  nameRenderer(supported: ["PlainUserNameRenderer", "MarkdownUserNameRenderer"]) {\n    __typename\n    ... on PlainUserNameRenderer {\n      ...RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name\n      __module_operation_RelayMockPayloadGeneratorTest31Fragment: js(module: "RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")\n      __module_component_RelayMockPayloadGeneratorTest31Fragment: js(module: "PlainUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")\n    }\n    ... on MarkdownUserNameRenderer {\n      ...RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name\n      __module_operation_RelayMockPayloadGeneratorTest31Fragment: js(module: "RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")\n      __module_component_RelayMockPayloadGeneratorTest31Fragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest31Fragment.nameRenderer")\n    }\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "nameRenderer": {\n        "__typename": "MarkdownUserNameRenderer",\n        "__module_operation_RelayMockPayloadGeneratorTest31Fragment": "RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$normalization",\n        "markdown": "<mock-value-for-field-\\\\"markdown\\\\">",\n        "data": {\n          "markup": "<mock-value-for-field-\\\\"markup\\\\">",\n          "id": "<MarkdownUserNameData-mock-id-2>"\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation should generate data for @match with PlainUserNameRenderer_name 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest46Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest32Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest32Fragment on User {\n  id\n  nameRenderer(supported: ["PlainUserNameRenderer", "MarkdownUserNameRenderer"]) {\n    __typename\n    ... on PlainUserNameRenderer {\n      ...RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name\n      __module_operation_RelayMockPayloadGeneratorTest32Fragment: js(module: "RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")\n      __module_component_RelayMockPayloadGeneratorTest32Fragment: js(module: "PlainUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")\n    }\n    ... on MarkdownUserNameRenderer {\n      ...RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name\n      __module_operation_RelayMockPayloadGeneratorTest32Fragment: js(module: "RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")\n      __module_component_RelayMockPayloadGeneratorTest32Fragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest32Fragment.nameRenderer")\n    }\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {\n  markdown\n  data {\n    markup\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name on PlainUserNameRenderer {\n  plaintext\n  data {\n    text\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "nameRenderer": {\n        "__typename": "PlainUserNameRenderer",\n        "__module_operation_RelayMockPayloadGeneratorTest32Fragment": "RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$normalization",\n        "plaintext": "<mock-value-for-field-\\\\"plaintext\\\\">",\n        "data": {\n          "text": "<mock-value-for-field-\\\\"text\\\\">",\n          "id": "<PlainUserNameData-mock-id-2>"\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation should generate data for @module 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest44Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTestNameRendererFragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name on MarkdownUserNameRenderer {\n  markdown\n  data {\n    markup\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTestNameRendererFragment on User {\n  id\n  nameRenderer {\n    __typename\n    ... on MarkdownUserNameRenderer {\n      ...RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name\n      __module_operation_RelayMockPayloadGeneratorTestNameRendererFragment: js(module: "RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTestNameRendererFragment.nameRenderer")\n      __module_component_RelayMockPayloadGeneratorTestNameRendererFragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTestNameRendererFragment.nameRenderer")\n    }\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "nameRenderer": {\n        "__typename": "MarkdownUserNameRenderer",\n        "__module_operation_RelayMockPayloadGeneratorTestNameRendererFragment": "RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$normalization",\n        "markdown": "<mock-value-for-field-\\\\"markdown\\\\">",\n        "data": {\n          "markup": "<mock-value-for-field-\\\\"markup\\\\">",\n          "id": "<MarkdownUserNameData-mock-id-2>"\n        }\n      }\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation should generate data for @module with \\`null\\` in mock resolvers 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest48Query {\n  node(id: "my-id") {\n    __typename\n    ...RelayMockPayloadGeneratorTest34Fragment\n    id\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest34Fragment on User {\n  id\n  nameRenderer {\n    __typename\n    ... on MarkdownUserNameRenderer {\n      ...RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name\n      __module_operation_RelayMockPayloadGeneratorTest34Fragment: js(module: "RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name$normalization.graphql", id: "RelayMockPayloadGeneratorTest34Fragment.nameRenderer")\n      __module_component_RelayMockPayloadGeneratorTest34Fragment: js(module: "MarkdownUserNameRenderer.react", id: "RelayMockPayloadGeneratorTest34Fragment.nameRenderer")\n    }\n  }\n}\n\nfragment RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {\n  markdown\n  data {\n    markup\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "nameRenderer": null\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation should throw if invalid default value provide for __module_operation. 1`] = `"RelayMockPayloadGenerator(): Unexpected default value for a field \\`__module_operation\\` in the mock resolver for @module dependency. Provided value is \\\\"{\\\\"kind\\\\":\\\\"InvalidObject\\\\"}\\\\" and we\'re expecting an object of a type \\`NormalizationSplitOperation\\`. Please adjust mock resolver for the type \\\\"MarkdownUserNameRenderer\\\\". Typically it should require a file \\\\"RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$normalization.graphql\\\\"."`;\n\nexports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation disabled 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest43Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>"\n    }\n  }\n}\n`;\n\nexports[`with @relay_test_operation with client extensions generate mock for client extensions with client generation enabled 1`] = `\n~~~~~~~~~~ INPUT ~~~~~~~~~~\nquery RelayMockPayloadGeneratorTest43Query {\n  node(id: "my-id") {\n    __typename\n    ... on User {\n      id\n    }\n    id\n  }\n}\n\n~~~~~~~~~~ OUTPUT ~~~~~~~~~~\n{\n  "data": {\n    "node": {\n      "__typename": "User",\n      "id": "<Node-mock-id-1>",\n      "client_name": "<mock-value-for-field-\\\\"client_name\\\\">",\n      "client_code": 42\n    }\n  }\n}\n`;\n', 'message': "adding support for client extensions in mock payload generator (#4030)\n\nSummary:\n## Problem\nAt Twitter we've been hoping to use MockPayloadGenerator to allow us to scaffold data in tests/[stories](https://storybook.js.org/) while our components use client side schema extensions. One of the engineers on my team discovered that this support is explicitly disallowed in the `relay` repo. I reached out to the discord channel and received feedback that enabling this would make sense.\n\n## Solution\nWithin `RelayMockPayloadGenerator.js`, modify the logic within `_traverseSelections` to recursively traverse the nested selections. This places the logic alongside `DEFER` and `STREAM`.\n\nA snapshot was updated as a result of this change —  local client extension `client_name` and `client_code` now have generated mocked fields.\n\nPull Request resolved: https://github.com/facebook/relay/pull/4030\n\nReviewed By: josephsavona\n\nDifferential Revision: D38659517\n\nPulled By: voideanvalue\n\nfbshipit-source-id: 77e5d5cc7abce644830eb632f95b128534f57abf\n", 'author_name': 'Facebook GitHub Bot', 'lang': 'js'}