├── .eslintignore ├── .eslintrc ├── .flowconfig ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── PATENTS ├── README.md ├── USERS.md ├── docs ├── APIReference-Container.md ├── APIReference-GraphQLMutation.md ├── APIReference-Mutation.md ├── APIReference-PropTypes.md ├── APIReference-QL.md ├── APIReference-Relay.md ├── APIReference-Renderer.md ├── APIReference-RootContainer.md ├── APIReference-Route.md ├── APIReference-Store.md ├── GraphQL-Connections.md ├── GraphQL-FurtherReading.md ├── GraphQL-Mutations.md ├── GraphQL-ObjectIdentification.md ├── GraphQL-RelaySpecification.md ├── Guides-BabelPlugin.md ├── Guides-Containers.md ├── Guides-Mutations.md ├── Guides-NetworkLayer.md ├── Guides-ReadyState.md ├── Guides-RootContainer.md ├── Guides-Routes.md ├── Interfaces-MutationRequest.md ├── Interfaces-NetworkLayer.md ├── Interfaces-QueryRequest.md ├── QuickStart-GettingStarted.md ├── QuickStart-GettingStarted.pt-br.md ├── QuickStart-GettingStarted.zh-CN.md ├── QuickStart-ThinkingInGraphQL.md ├── QuickStart-ThinkingInGraphQL.zh-CN.md ├── QuickStart-ThinkingInRelay.md ├── QuickStart-Tutorial.md ├── QuickStart-Tutorial.zh-CN.md ├── QuickStart-Videos.md └── modern │ ├── APICheatsheet.md │ ├── BabelPluginRelay.md │ ├── CompatibilityCheatsheet.md │ ├── ConversionPlaybook.md │ ├── ConversionScripts.md │ ├── Debugging.md │ ├── Environment.md │ ├── FragmentContainer.md │ ├── Introduction.md │ ├── Mutations.md │ ├── NetworkLayer.md │ ├── NewInRelayModern.md │ ├── PaginationContainer.md │ ├── QueryRenderer.md │ ├── RefetchContainer.md │ ├── RelayCompat.md │ ├── RelayCompiler.md │ ├── Routing.md │ ├── Subscriptions.md │ └── UpgradingSetVariables.md ├── gulpfile.js ├── meta ├── meeting-notes │ ├── 2016-02-02-sync-notes.md │ ├── 2016-02-05-product-requirements-and-core-values.md │ ├── 2016-02-09-team-sync.md │ ├── 2016-02-18-team-sync.md │ ├── 2016-03-01-team-sync.md │ ├── 2016-03-14-team-sync.md │ ├── 2016-03-22-team-sync.md │ ├── 2016-03-31-team-sync.md │ ├── 2016-04-05-team-sync.md │ ├── 2016-04-14-team-sync.md │ ├── 2016-04-19-team-sync.md │ ├── 2016-04-26-team-sync.md │ ├── 2016-05-03-team-sync.md │ ├── 2016-05-09-team-sync.md │ ├── 2016-05-17-team-sync.md │ ├── 2016-05-26-team-sync.md │ ├── 2016-05-31-team-sync.md │ ├── 2016-06-07-team-sync.md │ ├── 2016-06-14-team-sync.md │ ├── 2016-06-21-team-sync.md │ ├── 2016-07-05-team-sync.md │ ├── 2016-07-14-team-sync.md │ ├── 2016-07-21-team-sync.md │ ├── 2016-07-26-team-sync.md │ ├── 2016-08-09-team-sync.md │ ├── 2016-08-19-team-sync.md │ ├── 2016-08-23-team-sync.md │ ├── 2016-08-30-team-sync.md │ ├── 2016-09-06-team-sync.md │ ├── 2016-09-20-team-sync.md │ ├── 2016-12-09-update.md │ ├── 2017-01-17-team-sync.md │ ├── 2017-01-24-team-sync.md │ ├── 2017-02-07-team-sync.md │ ├── 2017-02-14-team-sync.md │ └── README.md └── roadmaps │ └── 2016-H1.md ├── package.json ├── packages ├── ARCHITECTURE.md ├── babel-plugin-relay │ ├── BabelPluginRelay.js │ ├── GraphQLRelayDirective.js │ ├── RelayQLAST.js │ ├── RelayQLNodeInterface.js │ ├── RelayQLPrinter.js │ ├── RelayQLTransformer.js │ ├── RelayTransformError.js │ ├── __tests__ │ │ ├── BabelPluginRelay-test.js │ │ ├── fixtures-classic │ │ │ ├── argsInvalidValues.golden.txt │ │ │ ├── argsInvalidValues.input.txt │ │ │ ├── argsSubstitution.golden.txt │ │ │ ├── argsSubstitution.input.txt │ │ │ ├── argsValues.golden.txt │ │ │ ├── argsValues.input.txt │ │ │ ├── argsVariablesList.golden.txt │ │ │ ├── argsVariablesList.input.txt │ │ │ ├── connectionPattern.golden.txt │ │ │ ├── connectionPattern.input.txt │ │ │ ├── connectionWithAfterLastArgs.golden.txt │ │ │ ├── connectionWithAfterLastArgs.input.txt │ │ │ ├── connectionWithAfterLastArgsWithInlineFragment.golden.txt │ │ │ ├── connectionWithAfterLastArgsWithInlineFragment.input.txt │ │ │ ├── connectionWithAfterLastOneVariableArgs.golden.txt │ │ │ ├── connectionWithAfterLastOneVariableArgs.input.txt │ │ │ ├── connectionWithAfterLastVariableArgs.golden.txt │ │ │ ├── connectionWithAfterLastVariableArgs.input.txt │ │ │ ├── connectionWithBeforeFirstArgs.golden.txt │ │ │ ├── connectionWithBeforeFirstArgs.input.txt │ │ │ ├── connectionWithFirstLastArgs.golden.txt │ │ │ ├── connectionWithFirstLastArgs.input.txt │ │ │ ├── connectionWithFirstLastVariableArgs.golden.txt │ │ │ ├── connectionWithFirstLastVariableArgs.input.txt │ │ │ ├── connectionWithNodesField.golden.txt │ │ │ ├── connectionWithNodesField.input.txt │ │ │ ├── connectionWithPageInfoAlias.golden.txt │ │ │ ├── connectionWithPageInfoAlias.input.txt │ │ │ ├── connectionWithPageInfoSubfields.golden.txt │ │ │ ├── connectionWithPageInfoSubfields.input.txt │ │ │ ├── connectionWithSelectVariables.golden.txt │ │ │ ├── connectionWithSelectVariables.input.txt │ │ │ ├── connectionWithoutArgs.golden.txt │ │ │ ├── connectionWithoutArgs.input.txt │ │ │ ├── connectionWithoutArgsWithInlineFragment.golden.txt │ │ │ ├── connectionWithoutArgsWithInlineFragment.input.txt │ │ │ ├── connectionWithoutNodeField.golden.txt │ │ │ ├── connectionWithoutNodeField.input.txt │ │ │ ├── connectionWithoutNodeID.golden.txt │ │ │ ├── connectionWithoutNodeID.input.txt │ │ │ ├── container.golden.txt │ │ │ ├── container.input.txt │ │ │ ├── fieldForEnum.golden.txt │ │ │ ├── fieldForEnum.input.txt │ │ │ ├── fieldWithAlias.golden.txt │ │ │ ├── fieldWithAlias.input.txt │ │ │ ├── fieldWithAliasAndArgs.golden.txt │ │ │ ├── fieldWithAliasAndArgs.input.txt │ │ │ ├── fieldWithArgs.golden.txt │ │ │ ├── fieldWithArgs.input.txt │ │ │ ├── fieldWithCustomScalarArg.golden.txt │ │ │ ├── fieldWithCustomScalarArg.input.txt │ │ │ ├── fieldWithEmptyArrayArg.golden.txt │ │ │ ├── fieldWithEmptyArrayArg.input.txt │ │ │ ├── fieldWithEnumArg.golden.txt │ │ │ ├── fieldWithEnumArg.input.txt │ │ │ ├── fieldWithEnumQueryArg.golden.txt │ │ │ ├── fieldWithEnumQueryArg.input.txt │ │ │ ├── fieldWithFakeConnection.golden.txt │ │ │ ├── fieldWithFakeConnection.input.txt │ │ │ ├── fieldWithParams.golden.txt │ │ │ ├── fieldWithParams.input.txt │ │ │ ├── fragment.golden.txt │ │ │ ├── fragment.input.txt │ │ │ ├── fragmentDirectives.golden.txt │ │ │ ├── fragmentDirectives.input.txt │ │ │ ├── fragmentOnBadType.golden.txt │ │ │ ├── fragmentOnBadType.input.txt │ │ │ ├── fragmentWithModuleName.golden.txt │ │ │ ├── fragmentWithModuleName.input.txt │ │ │ ├── fragmentWithName.golden.txt │ │ │ ├── fragmentWithName.input.txt │ │ │ ├── fragmentWithPossibleId.golden.txt │ │ │ ├── fragmentWithPossibleId.input.txt │ │ │ ├── fragmentWithReference.golden.txt │ │ │ ├── fragmentWithReference.input.txt │ │ │ ├── fragmentWithoutCommas.golden.txt │ │ │ ├── fragmentWithoutCommas.input.txt │ │ │ ├── inlineFragment.golden.txt │ │ │ ├── inlineFragment.input.txt │ │ │ ├── inlineFragmentWithoutType.golden.txt │ │ │ ├── inlineFragmentWithoutType.input.txt │ │ │ ├── introspectionQueryForSchema.golden.txt │ │ │ ├── introspectionQueryForSchema.input.txt │ │ │ ├── introspectionQueryForType.golden.txt │ │ │ ├── introspectionQueryForType.input.txt │ │ │ ├── metadataConnection.golden.txt │ │ │ ├── metadataConnection.input.txt │ │ │ ├── metadataConnectionLimitable.golden.txt │ │ │ ├── metadataConnectionLimitable.input.txt │ │ │ ├── metadataDynamic.golden.txt │ │ │ ├── metadataDynamic.input.txt │ │ │ ├── metadataGenerated.golden.txt │ │ │ ├── metadataGenerated.input.txt │ │ │ ├── metadataNonFindable.golden.txt │ │ │ ├── metadataNonFindable.input.txt │ │ │ ├── metadataPlural.golden.txt │ │ │ ├── metadataPlural.input.txt │ │ │ ├── metadataRequisite.golden.txt │ │ │ ├── metadataRequisite.input.txt │ │ │ ├── metadataVarArgs.golden.txt │ │ │ ├── metadataVarArgs.input.txt │ │ │ ├── mutation.golden.txt │ │ │ ├── mutation.input.txt │ │ │ ├── mutationBadSchemaMissingArgs.golden.txt │ │ │ ├── mutationBadSchemaMissingArgs.input.txt │ │ │ ├── mutationBadSchemaWrongArgs.golden.txt │ │ │ ├── mutationBadSchemaWrongArgs.input.txt │ │ │ ├── mutationWithExtraArgs.golden.txt │ │ │ ├── mutationWithExtraArgs.input.txt │ │ │ ├── mutationWithName.golden.txt │ │ │ ├── mutationWithName.input.txt │ │ │ ├── mutationWithoutArgs.golden.txt │ │ │ ├── mutationWithoutArgs.input.txt │ │ │ ├── nonExistentMutation.golden.txt │ │ │ ├── nonExistentMutation.input.txt │ │ │ ├── nonRootNodeField.golden.txt │ │ │ ├── nonRootNodeField.input.txt │ │ │ ├── pluralField.golden.txt │ │ │ ├── pluralField.input.txt │ │ │ ├── queryWithArrayObjectArg.golden.txt │ │ │ ├── queryWithArrayObjectArg.input.txt │ │ │ ├── queryWithArrayObjectNestedVariable.golden.txt │ │ │ ├── queryWithArrayObjectNestedVariable.input.txt │ │ │ ├── queryWithArrayObjectValue.golden.txt │ │ │ ├── queryWithArrayObjectValue.input.txt │ │ │ ├── queryWithBadDirective.golden.txt │ │ │ ├── queryWithBadDirective.input.txt │ │ │ ├── queryWithBadDirectiveArgs.golden.txt │ │ │ ├── queryWithBadDirectiveArgs.input.txt │ │ │ ├── queryWithDirectives.golden.txt │ │ │ ├── queryWithDirectives.input.txt │ │ │ ├── queryWithFields.golden.txt │ │ │ ├── queryWithFields.input.txt │ │ │ ├── queryWithName.golden.txt │ │ │ ├── queryWithName.input.txt │ │ │ ├── queryWithNestedFields.golden.txt │ │ │ ├── queryWithNestedFields.input.txt │ │ │ ├── queryWithNestedFragments.golden.txt │ │ │ ├── queryWithNestedFragments.input.txt │ │ │ ├── queryWithNullLiteral.golden.txt │ │ │ ├── queryWithNullLiteral.input.txt │ │ │ ├── queryWithObjectArg.golden.txt │ │ │ ├── queryWithObjectArg.input.txt │ │ │ ├── queryWithObjectArgNestedVariable.golden.txt │ │ │ ├── queryWithObjectArgNestedVariable.input.txt │ │ │ ├── queryWithObjectArgValue.golden.txt │ │ │ ├── queryWithObjectArgValue.input.txt │ │ │ ├── queryWithVarArgs.golden.txt │ │ │ ├── queryWithVarArgs.input.txt │ │ │ ├── queryWithoutFields.golden.txt │ │ │ ├── queryWithoutFields.input.txt │ │ │ ├── subscription.golden.txt │ │ │ ├── subscription.input.txt │ │ │ ├── tagRelayClassicQL.golden.txt │ │ │ ├── tagRelayClassicQL.input.txt │ │ │ ├── tagRelayQL.golden.txt │ │ │ ├── tagRelayQL.input.txt │ │ │ ├── templateString.golden.txt │ │ │ ├── templateString.input.txt │ │ │ ├── unionWithTypename.golden.txt │ │ │ └── unionWithTypename.input.txt │ │ ├── fixtures-compat-haste │ │ │ ├── arguments-listvalue.golden.txt │ │ │ ├── arguments-listvalue.input.txt │ │ │ ├── arguments.golden.txt │ │ │ ├── arguments.input.txt │ │ │ ├── duplicate-variables.golden.txt │ │ │ ├── duplicate-variables.input.txt │ │ │ ├── error_confusing-fragment-name.golden.txt │ │ │ ├── error_confusing-fragment-name.input.txt │ │ │ ├── error_too-many-fragments.golden.txt │ │ │ ├── error_too-many-fragments.input.txt │ │ │ ├── error_unexpected-fragment.golden.txt │ │ │ ├── error_unexpected-fragment.input.txt │ │ │ ├── error_unexpected-operation.golden.txt │ │ │ ├── error_unexpected-operation.input.txt │ │ │ ├── export-refetch-container.golden.txt │ │ │ ├── export-refetch-container.input.txt │ │ │ ├── fragment-spread.golden.txt │ │ │ ├── fragment-spread.input.txt │ │ │ ├── memoize-inner-scope.golden.txt │ │ │ ├── memoize-inner-scope.input.txt │ │ │ ├── module-operation.golden.txt │ │ │ ├── module-operation.input.txt │ │ │ ├── multiple-root-fields.golden.txt │ │ │ ├── multiple-root-fields.input.txt │ │ │ ├── mutation.golden.txt │ │ │ ├── mutation.input.txt │ │ │ ├── no-fragment-spread.golden.txt │ │ │ ├── no-fragment-spread.input.txt │ │ │ ├── no-object-many-fragments.golden.txt │ │ │ ├── no-object-many-fragments.input.txt │ │ │ ├── no-object.golden.txt │ │ │ ├── no-object.input.txt │ │ │ ├── query.golden.txt │ │ │ ├── query.input.txt │ │ │ ├── simple-named-fragment.golden.txt │ │ │ ├── simple-named-fragment.input.txt │ │ │ ├── simple-named-with-many-fragments.golden.txt │ │ │ ├── simple-named-with-many-fragments.input.txt │ │ │ ├── within-class-reference.golden.txt │ │ │ └── within-class-reference.input.txt │ │ ├── fixtures-compat │ │ │ ├── arguments-listvalue.golden.txt │ │ │ ├── arguments-listvalue.input.txt │ │ │ ├── arguments.golden.txt │ │ │ ├── arguments.input.txt │ │ │ ├── duplicate-variables.golden.txt │ │ │ ├── duplicate-variables.input.txt │ │ │ ├── error_confusing-fragment-name.golden.txt │ │ │ ├── error_confusing-fragment-name.input.txt │ │ │ ├── error_too-many-fragments.golden.txt │ │ │ ├── error_too-many-fragments.input.txt │ │ │ ├── error_unexpected-fragment.golden.txt │ │ │ ├── error_unexpected-fragment.input.txt │ │ │ ├── error_unexpected-operation.golden.txt │ │ │ ├── error_unexpected-operation.input.txt │ │ │ ├── export-refetch-container.golden.txt │ │ │ ├── export-refetch-container.input.txt │ │ │ ├── fragment-spread.golden.txt │ │ │ ├── fragment-spread.input.txt │ │ │ ├── memoize-inner-scope.golden.txt │ │ │ ├── memoize-inner-scope.input.txt │ │ │ ├── module-operation.golden.txt │ │ │ ├── module-operation.input.txt │ │ │ ├── multiple-root-fields.golden.txt │ │ │ ├── multiple-root-fields.input.txt │ │ │ ├── mutation.golden.txt │ │ │ ├── mutation.input.txt │ │ │ ├── no-fragment-spread.golden.txt │ │ │ ├── no-fragment-spread.input.txt │ │ │ ├── no-object-many-fragments.golden.txt │ │ │ ├── no-object-many-fragments.input.txt │ │ │ ├── no-object.golden.txt │ │ │ ├── no-object.input.txt │ │ │ ├── query.golden.txt │ │ │ ├── query.input.txt │ │ │ ├── simple-named-fragment.golden.txt │ │ │ ├── simple-named-fragment.input.txt │ │ │ ├── simple-named-with-many-fragments.golden.txt │ │ │ ├── simple-named-with-many-fragments.input.txt │ │ │ ├── within-class-reference.golden.txt │ │ │ └── within-class-reference.input.txt │ │ ├── fixtures-modern-haste │ │ │ ├── arguments-listvalue.golden.txt │ │ │ ├── arguments-listvalue.input.txt │ │ │ ├── arguments.golden.txt │ │ │ ├── arguments.input.txt │ │ │ ├── duplicate-variables.golden.txt │ │ │ ├── duplicate-variables.input.txt │ │ │ ├── error_confusing-fragment-name.golden.txt │ │ │ ├── error_confusing-fragment-name.input.txt │ │ │ ├── error_too-many-fragments.golden.txt │ │ │ ├── error_too-many-fragments.input.txt │ │ │ ├── error_unexpected-fragment.golden.txt │ │ │ ├── error_unexpected-fragment.input.txt │ │ │ ├── error_unexpected-operation.golden.txt │ │ │ ├── error_unexpected-operation.input.txt │ │ │ ├── export-refetch-container.golden.txt │ │ │ ├── export-refetch-container.input.txt │ │ │ ├── fragment-spread.golden.txt │ │ │ ├── fragment-spread.input.txt │ │ │ ├── memoize-inner-scope.golden.txt │ │ │ ├── memoize-inner-scope.input.txt │ │ │ ├── module-operation.golden.txt │ │ │ ├── module-operation.input.txt │ │ │ ├── multiple-root-fields.golden.txt │ │ │ ├── multiple-root-fields.input.txt │ │ │ ├── mutation.golden.txt │ │ │ ├── mutation.input.txt │ │ │ ├── no-fragment-spread.golden.txt │ │ │ ├── no-fragment-spread.input.txt │ │ │ ├── no-object-many-fragments.golden.txt │ │ │ ├── no-object-many-fragments.input.txt │ │ │ ├── no-object.golden.txt │ │ │ ├── no-object.input.txt │ │ │ ├── query.golden.txt │ │ │ ├── query.input.txt │ │ │ ├── simple-named-fragment.golden.txt │ │ │ ├── simple-named-fragment.input.txt │ │ │ ├── simple-named-with-many-fragments.golden.txt │ │ │ ├── simple-named-with-many-fragments.input.txt │ │ │ ├── within-class-reference.golden.txt │ │ │ └── within-class-reference.input.txt │ │ ├── fixtures-modern │ │ │ ├── arguments-listvalue.golden.txt │ │ │ ├── arguments-listvalue.input.txt │ │ │ ├── arguments.golden.txt │ │ │ ├── arguments.input.txt │ │ │ ├── duplicate-variables.golden.txt │ │ │ ├── duplicate-variables.input.txt │ │ │ ├── error_confusing-fragment-name.golden.txt │ │ │ ├── error_confusing-fragment-name.input.txt │ │ │ ├── error_too-many-fragments.golden.txt │ │ │ ├── error_too-many-fragments.input.txt │ │ │ ├── error_unexpected-fragment.golden.txt │ │ │ ├── error_unexpected-fragment.input.txt │ │ │ ├── error_unexpected-operation.golden.txt │ │ │ ├── error_unexpected-operation.input.txt │ │ │ ├── export-refetch-container.golden.txt │ │ │ ├── export-refetch-container.input.txt │ │ │ ├── fragment-spread.golden.txt │ │ │ ├── fragment-spread.input.txt │ │ │ ├── memoize-inner-scope.golden.txt │ │ │ ├── memoize-inner-scope.input.txt │ │ │ ├── module-operation.golden.txt │ │ │ ├── module-operation.input.txt │ │ │ ├── multiple-root-fields.golden.txt │ │ │ ├── multiple-root-fields.input.txt │ │ │ ├── mutation.golden.txt │ │ │ ├── mutation.input.txt │ │ │ ├── no-fragment-spread.golden.txt │ │ │ ├── no-fragment-spread.input.txt │ │ │ ├── no-object-many-fragments.golden.txt │ │ │ ├── no-object-many-fragments.input.txt │ │ │ ├── no-object.golden.txt │ │ │ ├── no-object.input.txt │ │ │ ├── query.golden.txt │ │ │ ├── query.input.txt │ │ │ ├── simple-named-fragment.golden.txt │ │ │ ├── simple-named-fragment.input.txt │ │ │ ├── simple-named-with-many-fragments.golden.txt │ │ │ ├── simple-named-with-many-fragments.input.txt │ │ │ ├── within-class-reference.golden.txt │ │ │ └── within-class-reference.input.txt │ │ └── testschema.rfc.graphql │ ├── compileGraphQLTag.js │ ├── compileRelayQLTag.js │ ├── computeLocation.js │ ├── createClassicNode.js │ ├── createCompatNode.js │ ├── createModernNode.js │ ├── createTransformError.js │ ├── find.js │ ├── getClassicTransformer.js │ ├── getDocumentName.js │ ├── getFragmentNameParts.js │ ├── getSchemaIntrospection.js │ ├── getValidGraphQLTag.js │ ├── getValidRelayQLTag.js │ ├── invariant.js │ └── package.json ├── react-relay │ ├── classic │ │ ├── ReactRelayClassicExports.js │ │ ├── RelayPublic.js │ │ ├── __forks__ │ │ │ └── interface │ │ │ │ ├── RelayConnectionInterface.js │ │ │ │ └── __mocks__ │ │ │ │ └── RelayConnectionInterface.js │ │ ├── __mocks__ │ │ │ ├── Relay.js │ │ │ └── RelayPublic.js │ │ ├── container │ │ │ ├── RelayContainer.js │ │ │ ├── RelayContainerComparators.js │ │ │ ├── RelayContainerProxy.js │ │ │ ├── RelayContainerUtils.js │ │ │ ├── RelayEventStatus.js │ │ │ ├── RelayPropTypes.js │ │ │ ├── RelayReadyStateRenderer.js │ │ │ ├── RelayRenderer.js │ │ │ ├── RelayRootContainer.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayContainer.js │ │ │ │ ├── RelayContainerProxy.js │ │ │ │ ├── RelayContainerUtils.js │ │ │ │ ├── RelayPropTypes.js │ │ │ │ ├── RelayReadyStateRenderer.js │ │ │ │ ├── getRelayQueries.js │ │ │ │ └── isRelayContainer.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayContainer-test.js │ │ │ │ ├── RelayContainerUtils-test.js │ │ │ │ ├── RelayContainer_Component-test.js │ │ │ │ ├── RelayContainer_hasFragmentData-test.js │ │ │ │ ├── RelayContainer_hasOptimisticUpdate-test.js │ │ │ │ ├── RelayContainer_hasPartialData-test.js │ │ │ │ ├── RelayContainer_setVariables-test.js │ │ │ │ ├── RelayReadyStateRenderer-test.js │ │ │ │ ├── RelayRenderer_abort-test.js │ │ │ │ ├── RelayRenderer_onReadyStateChange-test.js │ │ │ │ ├── RelayRenderer_render-test.js │ │ │ │ ├── RelayRenderer_renderArgs-test.js │ │ │ │ ├── RelayRenderer_requests-test.js │ │ │ │ ├── RelayRenderer_server-test.js │ │ │ │ ├── RelayRenderer_validation-test.js │ │ │ │ ├── getRelayQueries-test.js │ │ │ │ └── isRelayContainer-test.js │ │ │ ├── getRelayQueries.js │ │ │ └── isRelayContainer.js │ │ ├── environment │ │ │ ├── RelayClassicCore.js │ │ │ ├── RelayCombinedEnvironmentTypes.js │ │ │ ├── RelayEnvironmentTypes.js │ │ │ ├── RelayFragmentSpecResolver.js │ │ │ ├── RelayOperationSelector.js │ │ │ ├── RelaySelector.js │ │ │ ├── __mocks__ │ │ │ │ ├── isRelayContext.js │ │ │ │ ├── isRelayEnvironment.js │ │ │ │ └── isRelayVariables.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayFragmentSpecResolver-test.js │ │ │ │ ├── RelaySelector-test.js │ │ │ │ └── isRelayEnvironment-test.js │ │ │ ├── isRelayContext.js │ │ │ ├── isRelayEnvironment.js │ │ │ └── isRelayVariables.js │ │ ├── interface │ │ │ ├── RelayNodeInterface.js │ │ │ ├── RelayOSSConnectionInterface.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayNodeInterface.js │ │ │ │ └── RelayOSSConnectionInterface.js │ │ │ └── __tests__ │ │ │ │ └── RelayNodeInterface-test.js │ │ ├── legacy │ │ │ ├── mutation │ │ │ │ ├── GraphQLMutatorConstants.js │ │ │ │ └── __mocks__ │ │ │ │ │ └── GraphQLMutatorConstants.js │ │ │ └── store │ │ │ │ ├── GraphQLQueryRunner.js │ │ │ │ ├── GraphQLRange.js │ │ │ │ ├── GraphQLSegment.js │ │ │ │ ├── GraphQLStoreChangeEmitter.js │ │ │ │ ├── GraphQLStoreQueryResolver.js │ │ │ │ ├── GraphQLStoreRangeUtils.js │ │ │ │ ├── __mocks__ │ │ │ │ ├── GraphQLQueryRunner.js │ │ │ │ ├── GraphQLStoreChangeEmitter.js │ │ │ │ ├── GraphQLStoreQueryResolver.js │ │ │ │ ├── GraphQLStoreRangeUtils.js │ │ │ │ ├── GraphQLStoreTestUtils.js │ │ │ │ ├── generateClientEdgeID.js │ │ │ │ ├── generateClientID.js │ │ │ │ ├── generateForceIndex.js │ │ │ │ └── recycleNodesInto.js │ │ │ │ ├── __tests__ │ │ │ │ ├── GraphQLQueryRunner-test.js │ │ │ │ ├── GraphQLRange-test.js │ │ │ │ ├── GraphQLSegment-test.js │ │ │ │ ├── GraphQLStoreChangeEmitter-test.js │ │ │ │ ├── GraphQLStoreQueryResolver-test.js │ │ │ │ ├── GraphQLStoreRangeUtils-test.js │ │ │ │ └── recycleNodesInto-test.js │ │ │ │ ├── generateClientEdgeID.js │ │ │ │ ├── generateClientID.js │ │ │ │ └── generateForceIndex.js │ │ ├── mutation │ │ │ ├── RelayGraphQLMutation.js │ │ │ ├── RelayMutation.js │ │ │ ├── RelayMutationDebugPrinter.js │ │ │ ├── RelayMutationQuery.js │ │ │ ├── RelayMutationQueue.js │ │ │ ├── RelayMutationTransaction.js │ │ │ ├── RelayMutationTransactionStatus.js │ │ │ ├── RelayMutationType.js │ │ │ ├── RelayOptimisticMutationUtils.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayGraphQLMutation.js │ │ │ │ ├── RelayMutationQueue.js │ │ │ │ ├── RelayMutationTransaction.js │ │ │ │ ├── RelayMutationType.js │ │ │ │ ├── RelayOptimisticMutationUtils.js │ │ │ │ ├── getRangeBehavior.js │ │ │ │ ├── rangeOperationToMetadataKey.js │ │ │ │ └── validateMutationConfig.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayGraphQLMutation-test.js │ │ │ │ ├── RelayMutation-test.js │ │ │ │ ├── RelayMutationQuery-test.js │ │ │ │ ├── RelayMutationQueue-test.js │ │ │ │ ├── RelayMutation_integration-test.js │ │ │ │ ├── RelayOptimisticMutationUtils-test.js │ │ │ │ ├── getRangeBehavior-test.js │ │ │ │ ├── rangeOperationToMetadataKey-test.js │ │ │ │ └── validateMutationConfig-test.js │ │ │ ├── getRangeBehavior.js │ │ │ ├── rangeOperationToMetadataKey.js │ │ │ └── validateMutationConfig.js │ │ ├── network-layer │ │ │ └── default │ │ │ │ ├── RelayDefaultNetworkLayer.js │ │ │ │ ├── __mocks__ │ │ │ │ └── RelayDefaultNetworkLayer.js │ │ │ │ └── __tests__ │ │ │ │ └── RelayDefaultNetworkLayer-test.js │ │ ├── network │ │ │ ├── RelayMutationRequest.js │ │ │ ├── RelayNetworkLayer.js │ │ │ ├── RelayQueryRequest.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayMutationRequest.js │ │ │ │ ├── RelayNetworkLayer.js │ │ │ │ └── RelayQueryRequest.js │ │ │ └── __tests__ │ │ │ │ └── RelayNetworkLayer-test.js │ │ ├── query-config │ │ │ ├── RelayQueryConfig.js │ │ │ ├── __mocks__ │ │ │ │ └── RelayQueryConfig.js │ │ │ └── __tests__ │ │ │ │ └── RelayQueryConfig-test.js │ │ ├── query │ │ │ ├── ConcreteQuery.js │ │ │ ├── QueryBuilder.js │ │ │ ├── RelayFragmentPointer.js │ │ │ ├── RelayFragmentReference.js │ │ │ ├── RelayGraphQLTag.js │ │ │ ├── RelayQL.js │ │ │ ├── RelayQuery.js │ │ │ ├── RelayQueryPath.js │ │ │ ├── RelayQueryTransform.js │ │ │ ├── RelayQueryVisitor.js │ │ │ ├── RelayRefQueryDescriptor.js │ │ │ ├── RelayRouteFragment.js │ │ │ ├── RelayVariable.js │ │ │ ├── RelayVariables.js │ │ │ ├── __mocks__ │ │ │ │ ├── QueryBuilder.js │ │ │ │ ├── RelayFragmentPointer.js │ │ │ │ ├── RelayFragmentReference.js │ │ │ │ ├── RelayGraphQLTag.js │ │ │ │ ├── RelayQL.js │ │ │ │ ├── RelayQuery.js │ │ │ │ ├── RelayQueryPath.js │ │ │ │ ├── RelayQueryTransform.js │ │ │ │ ├── RelayQueryVisitor.js │ │ │ │ ├── RelayRefQueryDescriptor.js │ │ │ │ ├── RelayRouteFragment.js │ │ │ │ ├── RelayVariable.js │ │ │ │ ├── RelayVariables.js │ │ │ │ ├── buildRQL.js │ │ │ │ ├── callsFromGraphQL.js │ │ │ │ ├── callsToGraphQL.js │ │ │ │ ├── createRelayQuery.js │ │ │ │ ├── directivesToGraphQL.js │ │ │ │ ├── forEachRootCallArg.js │ │ │ │ ├── fromGraphQL.js │ │ │ │ ├── fromGraphQLQuery.js │ │ │ │ ├── generateConcreteFragmentID.js │ │ │ │ ├── generateRQLFieldAlias.js │ │ │ │ ├── serializeRelayQueryCall.js │ │ │ │ ├── stableStringify.js │ │ │ │ └── toGraphQL.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayFragmentPointer-test.js │ │ │ │ ├── RelayFragmentReference-test.js │ │ │ │ ├── RelayQL-test.js │ │ │ │ ├── RelayQuery-getCallsWithValues-test.js │ │ │ │ ├── RelayQuery-test.js │ │ │ │ ├── RelayQueryField-test.js │ │ │ │ ├── RelayQueryFragment-test.js │ │ │ │ ├── RelayQueryMutation-test.js │ │ │ │ ├── RelayQueryPath-test.js │ │ │ │ ├── RelayQueryRoot-test.js │ │ │ │ ├── RelayQueryTransform-test.js │ │ │ │ ├── RelayQueryVisitor-test.js │ │ │ │ ├── RelayVariables-test.js │ │ │ │ ├── buildRQL-test.js │ │ │ │ ├── callsToGraphQL-test.js │ │ │ │ ├── createRelayQuery-test.js │ │ │ │ ├── generateRQLFieldAlias-test.js │ │ │ │ ├── serializeRelayQueryCall-test.js │ │ │ │ ├── stableStringify-test.js │ │ │ │ └── toGraphQL-test.js │ │ │ ├── buildRQL.js │ │ │ ├── callsFromGraphQL.js │ │ │ ├── callsToGraphQL.js │ │ │ ├── createRelayQuery.js │ │ │ ├── directivesToGraphQL.js │ │ │ ├── forEachRootCallArg.js │ │ │ ├── fromGraphQL.js │ │ │ ├── generateConcreteFragmentID.js │ │ │ ├── generateRQLFieldAlias.js │ │ │ ├── serializeRelayQueryCall.js │ │ │ ├── stableStringify.js │ │ │ └── toGraphQL.js │ │ ├── route │ │ │ ├── RelayMetaRoute.js │ │ │ ├── RelayRoute.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayMetaRoute.js │ │ │ │ └── RelayRoute.js │ │ │ └── __tests__ │ │ │ │ ├── RelayMetaRoute-test.js │ │ │ │ └── RelayRoute-test.js │ │ ├── store │ │ │ ├── RelayCacheProcessor.js │ │ │ ├── RelayChangeTracker.js │ │ │ ├── RelayClassicRecordState.js │ │ │ ├── RelayEnvironment.js │ │ │ ├── RelayEnvironmentSerializer.js │ │ │ ├── RelayFetchMode.js │ │ │ ├── RelayGarbageCollection.js │ │ │ ├── RelayGarbageCollector.js │ │ │ ├── RelayMutationTracker.js │ │ │ ├── RelayPendingQueryTracker.js │ │ │ ├── RelayQueryResultObservable.js │ │ │ ├── RelayQueryTracker.js │ │ │ ├── RelayQueryWriter.js │ │ │ ├── RelayReadyState.js │ │ │ ├── RelayRecord.js │ │ │ ├── RelayRecordStatusMap.js │ │ │ ├── RelayRecordStore.js │ │ │ ├── RelayRecordWriter.js │ │ │ ├── RelayStore.js │ │ │ ├── RelayStoreConstants.js │ │ │ ├── RelayStoreData.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayCacheProcessor.js │ │ │ │ ├── RelayChangeTracker.js │ │ │ │ ├── RelayEnvironment.js │ │ │ │ ├── RelayFetchMode.js │ │ │ │ ├── RelayGarbageCollector.js │ │ │ │ ├── RelayMockCacheManager.js │ │ │ │ ├── RelayMutationTracker.js │ │ │ │ ├── RelayPendingQueryTracker.js │ │ │ │ ├── RelayQueryResultObservable.js │ │ │ │ ├── RelayQueryWriter.js │ │ │ │ ├── RelayReadyState.js │ │ │ │ ├── RelayRecord.js │ │ │ │ ├── RelayRecordStatusMap.js │ │ │ │ ├── RelayRecordStore.js │ │ │ │ ├── RelayRecordWriter.js │ │ │ │ ├── RelayStore.js │ │ │ │ ├── RelayStoreData.js │ │ │ │ ├── filterExclusiveKeys.js │ │ │ │ ├── isClassicRelayContext.js │ │ │ │ ├── isClassicRelayEnvironment.js │ │ │ │ ├── readRelayQueryData.js │ │ │ │ ├── restoreRelayCacheData.js │ │ │ │ └── validateRelayReadQuery.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayEnvironment-test.js │ │ │ │ ├── RelayEnvironment_classic-test.js │ │ │ │ ├── RelayGarbageCollector-test.js │ │ │ │ ├── RelayPendingQueryTracker-test.js │ │ │ │ ├── RelayQueryResultObservable-test.js │ │ │ │ ├── RelayQueryTracker-test.js │ │ │ │ ├── RelayQueryWriter-test.js │ │ │ │ ├── RelayReadyState-test.js │ │ │ │ ├── RelayRecord-test.js │ │ │ │ ├── RelayRecordStatusMap-test.js │ │ │ │ ├── RelayRecordStore-test.js │ │ │ │ ├── RelayRecordWriter-test.js │ │ │ │ ├── RelayStoreData-test.js │ │ │ │ ├── RelayStoreData_cacheManager-test.js │ │ │ │ ├── filterExclusiveKeys-test.js │ │ │ │ ├── isClassicRelayEnvironment-test.js │ │ │ │ ├── readRelayQueryData-test.js │ │ │ │ ├── readRelayQueryData_mutationStatus-test.js │ │ │ │ ├── restoreRelayCacheData-test.js │ │ │ │ └── validateRelayReadQuery-test.js │ │ │ ├── filterExclusiveKeys.js │ │ │ ├── isClassicRelayContext.js │ │ │ ├── isClassicRelayEnvironment.js │ │ │ ├── readRelayQueryData.js │ │ │ ├── restoreRelayCacheData.js │ │ │ └── validateRelayReadQuery.js │ │ ├── tools │ │ │ ├── RelayError.js │ │ │ ├── RelayInternalTypes.js │ │ │ ├── RelayInternals.js │ │ │ ├── RelayMetricsRecorder.js │ │ │ ├── RelayMockRenderer.js │ │ │ ├── RelayNetworkDebug.js │ │ │ ├── RelayProfiler.js │ │ │ ├── RelayQueryCaching.js │ │ │ ├── RelayShallowMock.js │ │ │ ├── RelayTaskQueue.js │ │ │ ├── RelayTypes.js │ │ │ ├── __mocks__ │ │ │ │ ├── RelayDeprecated.js │ │ │ │ ├── RelayError.js │ │ │ │ ├── RelayMetricsRecorder.js │ │ │ │ ├── RelayProfiler.js │ │ │ │ ├── RelayQueryCaching.js │ │ │ │ ├── RelayTestUtils.js │ │ │ │ ├── configureForRelayOSS.js │ │ │ │ ├── getGoldenMatchers.js │ │ │ │ ├── isCompatibleRelayFragmentType.js │ │ │ │ ├── matchRecord.js │ │ │ │ ├── relayUnstableBatchedUpdates.js │ │ │ │ └── testEditDistance.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayMetricsRecorder-test.js │ │ │ │ ├── RelayMockRenderer-test.js │ │ │ │ ├── RelayProfiler-test.js │ │ │ │ ├── RelayTaskQueue-test.js │ │ │ │ ├── RelayTestUtils-test.js │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── RelayMockRenderer-test.js.snap │ │ │ │ ├── dedent-test.js │ │ │ │ ├── deepFreeze-test.js │ │ │ │ ├── isCompatibleRelayFragmentType-test.js │ │ │ │ └── testEditDistance-test.js │ │ │ ├── dedent.js │ │ │ ├── deepFreeze.js │ │ │ ├── isCompatibleRelayFragmentType.js │ │ │ ├── relayUnstableBatchedUpdates.js │ │ │ ├── relayUnstableBatchedUpdates.native.js │ │ │ └── testEditDistance.js │ │ ├── traversal │ │ │ ├── __mocks__ │ │ │ │ ├── checkRelayQueryData.js │ │ │ │ ├── containsRelayQueryRootCall.js │ │ │ │ ├── diffRelayQuery.js │ │ │ │ ├── filterRelayQuery.js │ │ │ │ ├── findRelayQueryLeaves.js │ │ │ │ ├── flattenRelayQuery.js │ │ │ │ ├── flattenSplitRelayQueries.js │ │ │ │ ├── intersectRelayQuery.js │ │ │ │ ├── printRelayOSSQuery.js │ │ │ │ ├── printRelayQuery.js │ │ │ │ ├── splitDeferredRelayQueries.js │ │ │ │ ├── subtractRelayQuery.js │ │ │ │ ├── transformRelayQueryPayload.js │ │ │ │ ├── writeRelayQueryPayload.js │ │ │ │ └── writeRelayUpdatePayload.js │ │ │ ├── __tests__ │ │ │ │ ├── checkRelayQueryData-test.js │ │ │ │ ├── containsRelayQueryRootCall-test.js │ │ │ │ ├── diffRelayQuery-test.js │ │ │ │ ├── diffRelayQuery_connection-test.js │ │ │ │ ├── diffRelayQuery_fragments-test.js │ │ │ │ ├── diffRelayQuery_scalar-test.js │ │ │ │ ├── filterRelayQuery-test.js │ │ │ │ ├── findRelayQueryLeaves-test.js │ │ │ │ ├── flattenRelayQuery-test.js │ │ │ │ ├── flattenSplitRelayQueries-test.js │ │ │ │ ├── intersectRelayQuery-test.js │ │ │ │ ├── printRelayOSSQuery-test.js │ │ │ │ ├── splitDeferredRelayQueries-test.js │ │ │ │ ├── transformRelayQueryPayload-test.js │ │ │ │ ├── writeRelayQueryPayload_connectionField-test.js │ │ │ │ ├── writeRelayQueryPayload_defaultNull-test.js │ │ │ │ ├── writeRelayQueryPayload_linkedField-test.js │ │ │ │ ├── writeRelayQueryPayload_paths-test.js │ │ │ │ ├── writeRelayQueryPayload_pluralLinkedField-test.js │ │ │ │ ├── writeRelayQueryPayload_pluralScalarField-test.js │ │ │ │ ├── writeRelayQueryPayload_rootRecord-test.js │ │ │ │ ├── writeRelayQueryPayload_scalarField-test.js │ │ │ │ └── writeRelayUpdatePayload-test.js │ │ │ ├── checkRelayQueryData.js │ │ │ ├── containsRelayQueryRootCall.js │ │ │ ├── diffRelayQuery.js │ │ │ ├── filterRelayQuery.js │ │ │ ├── findRelayQueryLeaves.js │ │ │ ├── flattenRelayQuery.js │ │ │ ├── flattenSplitRelayQueries.js │ │ │ ├── intersectRelayQuery.js │ │ │ ├── printRelayOSSQuery.js │ │ │ ├── printRelayQuery.js │ │ │ ├── splitDeferredRelayQueries.js │ │ │ ├── transformRelayQueryPayload.js │ │ │ ├── writeRelayQueryPayload.js │ │ │ └── writeRelayUpdatePayload.js │ │ └── util │ │ │ ├── isScalarAndEqual.js │ │ │ └── throwFailedPromise.js │ ├── compat │ │ ├── ReactRelayCompatContainerBuilder.js │ │ ├── ReactRelayCompatPublic.js │ │ ├── RelayCompatEnvironment.js │ │ ├── __tests__ │ │ │ └── RelayCompatFragmentContainer-test.js │ │ ├── mutations │ │ │ └── RelayCompatMutations.js │ │ └── react │ │ │ ├── ForceRelayClassicContext.js │ │ │ ├── RelayCompatContainer.js │ │ │ ├── RelayCompatPaginationContainer.js │ │ │ ├── RelayCompatRefetchContainer.js │ │ │ └── RelayCompatTypes.js │ ├── modern │ │ ├── ReactRelayContainerProfiler.js │ │ ├── ReactRelayFragmentContainer.js │ │ ├── ReactRelayFragmentMockRenderer.js │ │ ├── ReactRelayPaginationContainer.js │ │ ├── ReactRelayPropTypes.js │ │ ├── ReactRelayPublic.js │ │ ├── ReactRelayQueryRenderer.js │ │ ├── ReactRelayRefetchContainer.js │ │ ├── ReactRelayTypes.js │ │ ├── __flowtests__ │ │ │ ├── ReactRelayFragmentContainer-flowtest.js │ │ │ ├── ReactRelayPaginationContainer-flowtest.js │ │ │ └── ReactRelayRefetchContainer-flowtest.js │ │ ├── __mocks__ │ │ │ └── ReactRelayTestMocker.js │ │ ├── __tests__ │ │ │ ├── ReactRelayFragmentContainer-test.js │ │ │ ├── ReactRelayFragmentMockRenderer-test.js │ │ │ ├── ReactRelayPaginationContainer-test.js │ │ │ ├── ReactRelayQueryRenderer-test.js │ │ │ ├── ReactRelayRefetchContainer-test.js │ │ │ └── __snapshots__ │ │ │ │ └── ReactRelayFragmentMockRenderer-test.js.snap │ │ ├── assertFragmentMap.js │ │ ├── buildReactRelayContainer.js │ │ └── isRelayModernContext.js │ └── package.json ├── relay-compiler │ ├── ARCHITECTURE.md │ ├── RelayCompilerPublic.js │ ├── bin │ │ └── RelayCompilerBin.js │ ├── codegen │ │ ├── CodegenDirectory.js │ │ ├── FindGraphQLTags.js │ │ ├── RelayCodegenRunner.js │ │ ├── RelayCodegenWatcher.js │ │ ├── RelayFileWriter.js │ │ ├── __tests__ │ │ │ └── FindGraphQLTags-test.js │ │ ├── flowtype │ │ │ ├── RelayFlowParser.js │ │ │ ├── __tests__ │ │ │ │ ├── RelayFlowParser-test.js │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── transformInputObjectToIR-test.js.snap │ │ │ │ ├── fixtures │ │ │ │ │ └── relay-flow-parser │ │ │ │ │ │ ├── fragment.golden.txt │ │ │ │ │ │ ├── fragment.input.rql │ │ │ │ │ │ ├── ignores-fixme-fat-interface.golden.txt │ │ │ │ │ │ ├── ignores-fixme-fat-interface.input.rql │ │ │ │ │ │ ├── ignores-relay-pattern-directive.golden.txt │ │ │ │ │ │ ├── ignores-relay-pattern-directive.input.rql │ │ │ │ │ │ ├── include-directive.golden.txt │ │ │ │ │ │ ├── include-directive.input.rql │ │ │ │ │ │ ├── skip-directive.golden.txt │ │ │ │ │ │ ├── skip-directive.input.rql │ │ │ │ │ │ ├── skip-invalid.golden.txt │ │ │ │ │ │ └── skip-invalid.input.rql │ │ │ │ ├── printFlowTypes-test.js │ │ │ │ └── transformInputObjectToIR-test.js │ │ │ ├── printFlowTypes.js │ │ │ └── transformInputObjectToIR.js │ │ ├── formatGeneratedModule.js │ │ ├── writeLegacyFlowFile.js │ │ └── writeRelayGeneratedFile.js │ ├── core │ │ ├── ASTConvert.js │ │ ├── FileParser.js │ │ ├── GraphQLFileParser.js │ │ ├── RelayCodeGenerator.js │ │ ├── RelayCompiledTypes.js │ │ ├── RelayCompiler.js │ │ ├── RelayCompilerContext.js │ │ ├── RelayCompilerScope.js │ │ ├── RelayCompilerUserError.js │ │ ├── RelayFileIRParser.js │ │ ├── RelayFlowGenerator.js │ │ ├── RelayIR.js │ │ ├── RelayIRTransformer.js │ │ ├── RelayIRTransforms.js │ │ ├── RelayIRVisitor.js │ │ ├── RelayParser.js │ │ ├── RelayPrinter.js │ │ ├── RelaySchemaUtils.js │ │ ├── RelayValidator.js │ │ ├── __tests__ │ │ │ ├── RelayCodeGenerator-test.js │ │ │ ├── RelayCompiler-test.js │ │ │ ├── RelayCompilerContext-test.js │ │ │ ├── RelayCompilerScope-test.js │ │ │ ├── RelayFlowGenerator-test.js │ │ │ ├── RelayIRTransformer-test.js │ │ │ ├── RelayIRVisitor-test.js │ │ │ ├── RelayParser-test.js │ │ │ ├── RelayPrinter-test.js │ │ │ ├── RelayValidator-test.js │ │ │ ├── __snapshots__ │ │ │ │ ├── RelayIRTransformer-test.js.snap │ │ │ │ └── RelayValidator-test.js.snap │ │ │ ├── filterContextForNode-test.js │ │ │ └── fixtures │ │ │ │ ├── code-generator │ │ │ │ ├── linked-handle-field.golden.txt │ │ │ │ ├── linked-handle-field.input.rql │ │ │ │ ├── query-with-fragment-variables.golden.txt │ │ │ │ ├── query-with-fragment-variables.input.rql │ │ │ │ ├── scalar-handle-field.golden.txt │ │ │ │ └── scalar-handle-field.input.rql │ │ │ │ ├── compiler │ │ │ │ ├── client-fields.golden.txt │ │ │ │ ├── client-fields.input.rql │ │ │ │ ├── connection.golden.txt │ │ │ │ ├── connection.input.rql │ │ │ │ ├── kitchen-sink.golden.txt │ │ │ │ ├── kitchen-sink.input.rql │ │ │ │ ├── linked-handle-field.golden.txt │ │ │ │ ├── linked-handle-field.input.rql │ │ │ │ ├── plural-fragment.golden.txt │ │ │ │ ├── plural-fragment.input.rql │ │ │ │ ├── scalar-handle-field.golden.txt │ │ │ │ ├── scalar-handle-field.input.rql │ │ │ │ ├── unions.golden.txt │ │ │ │ ├── unions.input.rql │ │ │ │ ├── viewer-query.golden.txt │ │ │ │ └── viewer-query.input.rql │ │ │ │ ├── filter-context │ │ │ │ ├── kitchen-sink.golden.txt │ │ │ │ └── kitchen-sink.input.rql │ │ │ │ ├── flow-generator │ │ │ │ ├── conditional.golden.txt │ │ │ │ ├── conditional.input.rql │ │ │ │ ├── fragment-spread.golden.txt │ │ │ │ ├── fragment-spread.input.rql │ │ │ │ ├── inline-fragment.golden.txt │ │ │ │ ├── inline-fragment.input.rql │ │ │ │ ├── linked-field.golden.txt │ │ │ │ ├── linked-field.input.rql │ │ │ │ ├── mutation-input-has-array.golden.txt │ │ │ │ ├── mutation-input-has-array.input.rql │ │ │ │ ├── mutation.golden.txt │ │ │ │ ├── mutation.input.rql │ │ │ │ ├── plural-fragment.golden.txt │ │ │ │ ├── plural-fragment.input.rql │ │ │ │ ├── roots.golden.txt │ │ │ │ ├── roots.input.rql │ │ │ │ ├── scalar-field.golden.txt │ │ │ │ ├── scalar-field.input.txt │ │ │ │ ├── typename-on-union.golden.txt │ │ │ │ └── typename-on-union.input.rql │ │ │ │ ├── parser │ │ │ │ ├── client-fields.golden.txt │ │ │ │ ├── client-fields.input.rql │ │ │ │ ├── directive-generic.golden.txt │ │ │ │ ├── directive-generic.input.rql │ │ │ │ ├── directive-include.golden.json │ │ │ │ ├── directive-include.input.rql │ │ │ │ ├── field-arguments.golden.json │ │ │ │ ├── field-arguments.input.rql │ │ │ │ ├── fragment-with-arguments.golden.json │ │ │ │ ├── fragment-with-arguments.input.rql │ │ │ │ ├── inline-untyped-fragment.golden.txt │ │ │ │ ├── inline-untyped-fragment.input.rql │ │ │ │ ├── linked-handle-field-with-filters.golden.txt │ │ │ │ ├── linked-handle-field-with-filters.input.ql │ │ │ │ ├── linked-handle-field-with-key.golden.txt │ │ │ │ ├── linked-handle-field-with-key.input.ql │ │ │ │ ├── linked-handle-field.golden.txt │ │ │ │ ├── linked-handle-field.input.rql │ │ │ │ ├── linked-handle-filter.golden.txt │ │ │ │ ├── linked-handle-filter.input.ql │ │ │ │ ├── list-argument.golden.txt │ │ │ │ ├── list-argument.input.rql │ │ │ │ ├── list-of-enums.golden.txt │ │ │ │ ├── list-of-enums.input.rql │ │ │ │ ├── literal-list-argument.golden.txt │ │ │ │ ├── literal-list-argument.input.rql │ │ │ │ ├── literal-object-argument.golden.txt │ │ │ │ ├── literal-object-argument.input.rql │ │ │ │ ├── object-argument.golden.txt │ │ │ │ ├── object-argument.input.rql │ │ │ │ ├── scalar-handle-field.golden.txt │ │ │ │ ├── scalar-handle-field.input.rql │ │ │ │ ├── simple-fragment.golden.json │ │ │ │ ├── simple-fragment.input.rql │ │ │ │ ├── simple-query.golden.json │ │ │ │ └── simple-query.input.rql │ │ │ │ ├── printer │ │ │ │ ├── kitchen-sink.golden.txt │ │ │ │ └── kitchen-sink.input.rql │ │ │ │ └── visitor │ │ │ │ ├── mutate-visit │ │ │ │ ├── mutate-nodes.golden.txt │ │ │ │ └── mutate-nodes.input.rql │ │ │ │ └── no-op-visit │ │ │ │ ├── no-op.golden.txt │ │ │ │ └── no-op.input.rql │ │ ├── filterContextForNode.js │ │ ├── getIdentifierForRelayArgumentValue.js │ │ ├── getIdentifierForRelaySelection.js │ │ └── getRelayLiteralArgumentValues.js │ ├── handlers │ │ ├── connection │ │ │ ├── RelayConnectionConstants.js │ │ │ ├── RelayConnectionTransform.js │ │ │ └── __tests__ │ │ │ │ ├── RelayConnectionTransform-test.js │ │ │ │ └── fixtures │ │ │ │ ├── connection-transform-generate-requisite-fields │ │ │ │ ├── connection.golden.txt │ │ │ │ └── connection.input.rql │ │ │ │ └── connection-transform │ │ │ │ ├── connection-directions.golden.txt │ │ │ │ ├── connection-directions.input.rql │ │ │ │ ├── connection-filters.golden.txt │ │ │ │ ├── connection-filters.input.rql │ │ │ │ ├── connection-generate-filters.golden.txt │ │ │ │ ├── connection-generate-filters.input.rql │ │ │ │ ├── connection-with-variables.golden.txt │ │ │ │ ├── connection-with-variables.input.rql │ │ │ │ ├── connection.golden.txt │ │ │ │ ├── connection.input.rql │ │ │ │ ├── invalid-type.golden.txt │ │ │ │ ├── invalid-type.input.rql │ │ │ │ ├── missing-first-arg.golden.txt │ │ │ │ └── missing-first-arg.input.rql │ │ └── viewer │ │ │ ├── RelayViewerHandleTransform.js │ │ │ └── __tests__ │ │ │ ├── RelayViewerHandleTransform-test.js │ │ │ └── fixtures │ │ │ └── viewer-handle-transform │ │ │ ├── mutation-with-handle.golden.txt │ │ │ ├── mutation-with-handle.input.rql │ │ │ ├── mutation.golden.txt │ │ │ ├── mutation.input.rql │ │ │ ├── query-with-handle.golden.txt │ │ │ ├── query-with-handle.input.rql │ │ │ ├── query.golden.txt │ │ │ └── query.input.rql │ ├── package.json │ ├── testutils │ │ ├── RelayTestSchema.js │ │ ├── parseGraphQLText.js │ │ └── testschema.graphql │ ├── transforms │ │ ├── RelayApplyFragmentArgumentTransform.js │ │ ├── RelayAutoAliasTransform.js │ │ ├── RelayFieldHandleTransform.js │ │ ├── RelayFilterDirectivesTransform.js │ │ ├── RelayFlattenTransform.js │ │ ├── RelayGenerateRequisiteFieldsTransform.js │ │ ├── RelayRelayDirectiveTransform.js │ │ ├── RelaySkipClientFieldTransform.js │ │ ├── RelaySkipHandleFieldTransform.js │ │ ├── RelaySkipRedundantNodesTransform.js │ │ ├── RelaySkipUnreachableNodeTransform.js │ │ ├── RelayStripUnusedVariablesTransform.js │ │ └── __tests__ │ │ │ ├── RelayApplyFragmentArgumentTransform-test.js │ │ │ ├── RelayAutoAliasTransform-test.js │ │ │ ├── RelayFieldHandleTransform-test.js │ │ │ ├── RelayFilterDirectivesTransform-test.js │ │ │ ├── RelayFlattenTransform-test.js │ │ │ ├── RelayGenerateRequisiteFieldsTransform-test.js │ │ │ ├── RelayRelayDirectiveTransform-test.js │ │ │ ├── RelaySkipClientFieldTransform-test.js │ │ │ ├── RelaySkipHandleFieldTransform-test.js │ │ │ ├── RelaySkipRedundantNodesTransform-test.js │ │ │ ├── RelaySkipUnreachableNodeTransform-test.js │ │ │ ├── RelayStripUnusedVariablesTransform-test.js │ │ │ └── fixtures │ │ │ ├── apply-fragment-argument-transform │ │ │ ├── deletes-unreferenced-fragments.golden.txt │ │ │ ├── deletes-unreferenced-fragments.input.rql │ │ │ ├── inlines-fragment-arguments.golden.txt │ │ │ ├── inlines-fragment-arguments.input.rql │ │ │ ├── merges-identical-fragments.golden.txt │ │ │ └── merges-identical-fragments.input.rql │ │ │ ├── auto-alias-transform │ │ │ ├── auto-aliases-fields.golden.txt │ │ │ └── auto-aliases-fields.input.rql │ │ │ ├── field-handle-transform │ │ │ ├── linked-handle-field-filter.golden.txt │ │ │ ├── linked-handle-field-filter.input.ql │ │ │ ├── linked-handle-field.golden.txt │ │ │ ├── linked-handle-field.input.rql │ │ │ ├── scalar-handle-field.golden.txt │ │ │ └── scalar-handle-field.input.rql │ │ │ ├── filter-directives-transform │ │ │ ├── directives.golden.txt │ │ │ └── directives.input.rql │ │ │ ├── flatten-transform-errors │ │ │ ├── flatten-same-alias-different-args.golden.txt │ │ │ └── flatten-same-alias-different-args.input.rql │ │ │ ├── flatten-transform-option-flatten-abstract │ │ │ ├── flatten-abstract-fragments.golden.txt │ │ │ └── flatten-abstract-fragments.input.rql │ │ │ ├── flatten-transform-option-flatten-conditions │ │ │ ├── flatten-conditions.golden.txt │ │ │ └── flatten-conditions.input.rql │ │ │ ├── flatten-transform-option-flatten-inline │ │ │ ├── flatten-inline-fragments.golden.txt │ │ │ └── flatten-inline-fragments.input.rql │ │ │ ├── flatten-transform-option-flatten-spreads │ │ │ ├── inlines-nested-fragments.golden.txt │ │ │ ├── inlines-nested-fragments.input.rql │ │ │ ├── merges-aliased-fields.golden.txt │ │ │ ├── merges-aliased-fields.input.rql │ │ │ ├── merges-unaliased-fields.golden.txt │ │ │ └── merges-unaliased-fields.input.rql │ │ │ ├── flatten-transform │ │ │ ├── flattens-matching-fragment-types.golden.txt │ │ │ ├── flattens-matching-fragment-types.input.rql │ │ │ ├── linked-handle-field.golden.txt │ │ │ ├── linked-handle-field.input.rql │ │ │ ├── scalar-handle-field.golden.txt │ │ │ └── scalar-handle-field.input.rql │ │ │ ├── generate-requisite-fields-transform │ │ │ ├── abstract-plural.golden.txt │ │ │ ├── abstract-plural.input.rql │ │ │ ├── node-union.golden.txt │ │ │ ├── node-union.input.rql │ │ │ ├── non-node-union.golden.txt │ │ │ ├── non-node-union.input.rql │ │ │ ├── query-with-fragment-variables.golden.txt │ │ │ └── query-with-fragment-variables.input.rql │ │ │ ├── relay-directive-transform │ │ │ ├── plural-fragment.golden.txt │ │ │ └── plural-fragment.input.rql │ │ │ ├── skip-client-field-transform │ │ │ ├── client-fields.golden.txt │ │ │ └── client-fields.input.rql │ │ │ ├── skip-handle-field-transform │ │ │ ├── mutation-with-handle.golden.txt │ │ │ ├── mutation-with-handle.input.rql │ │ │ ├── query-with-handle.golden.txt │ │ │ └── query-with-handle.input.rql │ │ │ ├── skip-redundant-nodes-transform │ │ │ ├── dont-skip-different-ids.golden.txt │ │ │ ├── dont-skip-different-ids.input.rql │ │ │ ├── dont-skip-nested-fields-across-fragments.golden.txt │ │ │ ├── dont-skip-nested-fields-across-fragments.input.rql │ │ │ ├── skip-nested-linked-fields.golden.txt │ │ │ ├── skip-nested-linked-fields.input.rql │ │ │ ├── skips-nested-fields.golden.txt │ │ │ ├── skips-nested-fields.input.rql │ │ │ ├── skips-with-outer-fields-first.golden.txt │ │ │ ├── skips-with-outer-fields-first.input.rql │ │ │ ├── skips-with-outer-fields-last.golden.txt │ │ │ └── skips-with-outer-fields-last.input.rql │ │ │ ├── skip-unreachable-node-transform │ │ │ ├── keeps-other-fields.golden.txt │ │ │ ├── keeps-other-fields.input.rql │ │ │ ├── removes-include-false.golden.txt │ │ │ ├── removes-include-false.input.rql │ │ │ ├── removes-skip-true.golden.txt │ │ │ └── removes-skip-true.input.rql │ │ │ └── strip-unused-variables-transform │ │ │ ├── kitchen-sink.golden.txt │ │ │ └── kitchen-sink.input.rql │ └── util │ │ ├── __tests__ │ │ └── getModuleName-test.js │ │ ├── getModuleName.js │ │ └── murmurHash.js └── relay-runtime │ ├── ARCHITECTURE.md │ ├── RelayRuntime.js │ ├── __mocks__ │ ├── RelayModernMockEnvironment.js │ └── RelayModernTestUtils.js │ ├── __tests__ │ └── RelayModernTestUtils-test.js │ ├── debugger │ ├── RelayDebugger.js │ └── __tests__ │ │ └── RelayDebugger-test.js │ ├── handlers │ ├── RelayDefaultHandlerProvider.js │ ├── connection │ │ ├── RelayConnectionHandler.js │ │ └── __tests__ │ │ │ └── RelayConnectionHandler-test.js │ └── viewer │ │ ├── RelayViewerHandler.js │ │ └── __tests__ │ │ └── RelayViewerHandler-test.js │ ├── mutations │ ├── RelayRecordProxy.js │ ├── RelayRecordProxyReader.js │ ├── RelayRecordSourceMutator.js │ ├── RelayRecordSourceProxy.js │ ├── RelayRecordSourceSelectorProxy.js │ ├── __tests__ │ │ ├── RelayRecordSourceMutator-test.js │ │ ├── RelayRecordSourceProxy-test.js │ │ └── commitRelayModernMutation-test.js │ ├── commitLocalUpdate.js │ ├── commitRelayModernMutation.js │ └── setRelayModernMutationConfigs.js │ ├── network │ ├── RelayNetwork.js │ ├── RelayNetworkLogger.js │ ├── RelayNetworkTypes.js │ ├── RelayQueryResponseCache.js │ └── __tests__ │ │ └── RelayQueryResponseCache-test.js │ ├── package.json │ ├── query │ ├── RelayModernGraphQLTag.js │ ├── __tests__ │ │ └── fetchRelayModernQuery-test.js │ └── fetchRelayModernQuery.js │ ├── store │ ├── RelayAsyncLoader.js │ ├── RelayConcreteVariables.js │ ├── RelayCore.js │ ├── RelayInMemoryRecordSource.js │ ├── RelayMarkSweepStore.js │ ├── RelayModernEnvironment.js │ ├── RelayModernFragmentSpecResolver.js │ ├── RelayModernOperationSelector.js │ ├── RelayModernRecord.js │ ├── RelayModernSelector.js │ ├── RelayPublishQueue.js │ ├── RelayReader.js │ ├── RelayRecordSourceInspector.js │ ├── RelayRecordState.js │ ├── RelayReferenceMarker.js │ ├── RelayResponseNormalizer.js │ ├── RelayStoreProxyDebugger.js │ ├── RelayStoreTypes.js │ ├── RelayStoreUtils.js │ ├── __mocks__ │ │ └── RelayRecordState.js │ ├── __tests__ │ │ ├── RelayAsyncLoader-test.js │ │ ├── RelayConcreteVariables-test.js │ │ ├── RelayCore-test.js │ │ ├── RelayMarkSweepStore-test.js │ │ ├── RelayModernEnvironment-test.js │ │ ├── RelayModernFragmentSpecResolver-test.js │ │ ├── RelayModernRecord-test.js │ │ ├── RelayModernSelector-test.js │ │ ├── RelayPublishQueue-test.js │ │ ├── RelayReader-test.js │ │ ├── RelayRecordSourceInspector-test.js │ │ ├── RelayReferenceMarker-test.js │ │ ├── RelayResponseNormalizer-test.js │ │ ├── RelayStoreUtils-test.js │ │ ├── __snapshots__ │ │ │ └── RelayResponseNormalizer-test.js.snap │ │ ├── cloneRelayHandleSourceField-test.js │ │ └── isRelayStaticEnvironment-test.js │ ├── cloneRelayHandleSourceField.js │ ├── generateRelayClientID.js │ ├── hasOverlappingIDs.js │ ├── isRelayModernEnvironment.js │ └── normalizeRelayPayload.js │ ├── subscription │ └── requestRelaySubscription.js │ └── util │ ├── RelayConcreteNode.js │ ├── RelayDefaultHandleKey.js │ ├── __tests__ │ └── stableJSONStringify-test.js │ ├── formatStorageKey.js │ ├── getRelayHandleKey.js │ ├── isPromise.js │ ├── prettyStringify.js │ ├── recycleNodesInto.js │ ├── simpleClone.js │ └── stableJSONStringify.js ├── scripts ├── .babelrc ├── getBabelOptions.js ├── jest │ ├── environment.js │ └── preprocessor.js └── publish_packages ├── website-prototyping-tools ├── HelloApp.js ├── HelloSchema.js ├── RelayPlayground.css ├── RelayPlayground.js ├── babelRelayPlaygroundPlugin.js ├── evalSchema.js ├── graphiql.js ├── logo.svg ├── package.json ├── playground.html ├── playground.js └── webpack.config.js ├── website ├── README.md ├── core │ ├── DocsSidebar.js │ ├── Footer.js │ ├── H2.js │ ├── Header.js │ ├── HeaderLinks.js │ ├── Marked.js │ ├── Prism.js │ ├── Site.js │ ├── center.js │ ├── metadata.js │ └── unindent.js ├── graphql │ ├── Connections.md │ ├── Mutations.md │ └── ObjectIdentification.md ├── layout │ ├── DocsLayout.js │ └── PageLayout.js ├── package.json ├── publish.sh ├── server │ ├── buildGraphQLSpec.js │ ├── convert.js │ ├── generate.js │ └── server.js └── src │ ├── elements │ └── favicon │ │ └── favicon.ico │ └── relay │ ├── css │ └── relay.css │ ├── img │ ├── Guides-Containers-HOC-Relay.png │ ├── favicon.png │ └── logo.svg │ ├── index.js │ └── support.js └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | docs/ 3 | **/node_modules/ 4 | lib/ 5 | scripts/lib/ 6 | # TODO: Enable ESLint for website. 7 | website/ 8 | website-prototyping-tools/HelloApp.js 9 | website-prototyping-tools/node_modules 10 | *.md 11 | src/flow/ 12 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | extends: 4 | - fbjs 5 | 6 | rules: 7 | # this is very noisy, so disable 8 | consistent-return: 0 9 | # Prettier and ESLint may disagree on the following rules 10 | indent: 0 11 | array-bracket-spacing: 0 12 | comma-dangle: 0 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nvmrc 2 | node_modules 3 | npm-debug.log 4 | /dist/ 5 | /lib/ 6 | /website/build 7 | /website/src/relay/docs 8 | /website/src/relay/graphql 9 | /website/src/relay/prototyping 10 | .idea 11 | -------------------------------------------------------------------------------- /docs/modern/ConversionScripts.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: conversion-scripts 3 | title: Conversion Scripts 4 | layout: docs 5 | category: Relay Compat 6 | permalink: docs/conversion-scripts.html 7 | next: upgrading-setvariables 8 | --- 9 | 10 | 我們寫了一些腳本來幫助你度過轉換的過程。在 https://github.com/relayjs/relay-codemod 可以找到他們。 11 | -------------------------------------------------------------------------------- /meta/meeting-notes/README.md: -------------------------------------------------------------------------------- 1 | # About the meeting notes 2 | 3 | Starting February 2016, the Relay Team at Facebook intends to publish notes from its internal meetings here in the project repo. We're doing this because not all of the work we do on Relay is visible externally, and even when it is visible external users may not have enough context to make sense of it, and we'd like the development process to be as transparent as possible. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/RelayQLNodeInterface.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @flow 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | const RelayQLNodeInterface = { 16 | ID: 'id', 17 | }; 18 | 19 | module.exports = RelayQLNodeInterface; 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/argsInvalidValues.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query Args { 3 | node(id: 123) { 4 | ... on User { 5 | friends( 6 | first: "10" 7 | orderby: Name 8 | find: cursor1 9 | isViewerFriend: "true" 10 | gender: "MALE" 11 | ) { 12 | edges { 13 | node { 14 | id 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } 21 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/argsSubstitution.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query Args { 3 | node(id: ${userID}) { 4 | id 5 | } 6 | } 7 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/argsValues.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query Args { 3 | node(id: 123) { 4 | ... on User { 5 | friends( 6 | first: 10 7 | orderby: "Name" 8 | find: "cursor1" 9 | isViewerFriend: true 10 | gender: MALE 11 | ) { 12 | edges { 13 | node { 14 | id 15 | firstName(if: true, unless: false) 16 | } 17 | } 18 | } 19 | } 20 | } 21 | } 22 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/argsVariablesList.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query Args { 3 | nodes(ids: [$one, $two, 3]) { 4 | id 5 | } 6 | } 7 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionPattern.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on User @relay(pattern: true) { 4 | friends { 5 | edges { 6 | node { 7 | id 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Connection arguments `friends(after: , last: )` are not supported unless both are variables. Use `(last: )`, `(before: , last: )`, `(after: , first: )`, or `(after: $, last: $)`.`` in file `connectionWithAfterLastArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(last: 3, after: "foo") { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastArgsWithInlineFragment.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Connection arguments `friends(after: , last: )` are not supported unless both are variables. Use `(last: )`, `(before: , last: )`, `(after: , first: )`, or `(after: $, last: $)`.`` in file `connectionWithAfterLastArgsWithInlineFragment.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastArgsWithInlineFragment.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(last: 3, after: "foo") { 7 | ... on UserConnection { 8 | edges { 9 | node { 10 | id 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | } 18 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastOneVariableArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Connection arguments `friends(after: , last: )` are not supported unless both are variables. Use `(last: )`, `(before: , last: )`, `(after: , first: )`, or `(after: $, last: $)`.`` in file `connectionWithAfterLastOneVariableArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastOneVariableArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(last: $last, after: "foo") { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithAfterLastVariableArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(after: $after, last: $last) { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithBeforeFirstArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Connection arguments `friends(before: , first: )` are not supported unless both are variables. Use `(first: )`, `(after: , first: )`, `(before: , last: )`, or `(before: $, first: $)`.`` in file `connectionWithBeforeFirstArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithBeforeFirstArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3, before: "foo") { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithFirstLastArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Connection arguments `friends(first: , last: )` are not supported unless both are variables. Use `(first: )`, `(last: )`, or `(first: $, last: $)`.`` in file `connectionWithFirstLastArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithFirstLastArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3, last: 3) { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithFirstLastVariableArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: $first, last: $last) { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithNodesField.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``You supplied a field named `nodes` on a connection named `friends`, but pagination is not supported on connections without using `edges`. Use `friends{edges{node{...}}}` instead.`` in file `connectionWithNodesField.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithNodesField.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3) { 7 | nodes { 8 | id 9 | } 10 | } 11 | } 12 | } 13 | } 14 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithPageInfoAlias.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3) { 7 | edges { 8 | node { 9 | name 10 | } 11 | } 12 | myPageInfo: pageInfo { 13 | hasPreviousPage 14 | } 15 | } 16 | } 17 | } 18 | } 19 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithPageInfoSubfields.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3) { 7 | edges { 8 | node { 9 | name 10 | } 11 | } 12 | pageInfo 13 | } 14 | } 15 | } 16 | } 17 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithoutArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``You supplied the `edges` field on a connection named `friends`, but you did not supply an argument necessary for Relay to handle the connection. Please specify a limit argument like `first`, or `last` or fetch a specific item with a `find` argument.`` in file `connectionWithoutArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithoutArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithoutArgsWithInlineFragment.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``You supplied the `edges` field on a connection named `friends`, but you did not supply an argument necessary for Relay to handle the connection. Please specify a limit argument like `first`, or `last` or fetch a specific item with a `find` argument.`` in file `connectionWithoutArgsWithInlineFragment.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithoutArgsWithInlineFragment.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends { 7 | ... on UserConnection { 8 | edges { 9 | node { 10 | id 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | } 18 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithoutNodeField.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3) { 7 | edges { 8 | cursor 9 | } 10 | } 11 | } 12 | } 13 | } 14 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/connectionWithoutNodeID.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3) @relay(isConnectionWithoutNodeID: true) { 7 | edges { 8 | cursor 9 | } 10 | } 11 | } 12 | } 13 | } 14 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/container.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | Relay.createContainer(Component, { 3 | queries: { 4 | viewer: () => Relay.QL`fragment on Viewer { actor { id } }` 5 | } 6 | }); -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldForEnum.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | gender 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithAlias.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | realName: name 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithAliasAndArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | mugShot: profilePicture(size: 100) { 7 | uri 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | profilePicture(size: 100) { 7 | uri 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithCustomScalarArg.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | customScalar(arg: {give: "relay"}) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithEmptyArrayArg.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on User { 4 | friends(isViewerFriend: false) { 5 | count 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithEnumArg.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 5, gender: MALE) { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithEnumQueryArg.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query($gender_0: Gender) { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 5, gender: $gender_0) { 7 | edges { 8 | node { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithFakeConnection.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var foo = Relay.QL` 3 | fragment on User { 4 | fakeConnection { 5 | edges { 6 | node { 7 | id 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fieldWithParams.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | profilePicture(size: $size) { 7 | uri 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragment.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`fragment on Node { id }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentDirectives.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`fragment on Node @relay(plural: true) { id }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentOnBadType.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('GraphQL validation error ``Unknown type "NotAType". Did you mean "__Type"?`` in file `fragmentOnBadType.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentOnBadType.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`fragment on NotAType { id }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentWithModuleName.input.txt: -------------------------------------------------------------------------------- 1 | /** @providesModule Foo.react */ 2 | var Relay = require('react-relay'); 3 | var x = Relay.QL`fragment Foo on Node { id }`; 4 | var y = Relay.QL`fragment Bar on Node { id }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentWithName.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`fragment FragmentNameHere on Node { id }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentWithPossibleId.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on Actor { 4 | name 5 | ... on User { id } 6 | } 7 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentWithReference.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`fragment on Node { ${reference} }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/fragmentWithoutCommas.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on Node { 4 | ${reference} 5 | id 6 | } 7 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/inlineFragment.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on Node { 4 | ... on User { 5 | userOnlyField 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/inlineFragmentWithoutType.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | /* 3 | TODO: Upgrade to graphql@0.4.7 and uncomment this. 4 | 5 | var x = Relay.QL` 6 | fragment on Node { 7 | ... { 8 | id 9 | } 10 | } 11 | `; 12 | */ 13 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/inlineFragmentWithoutType.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | /* 3 | TODO: Upgrade to graphql@0.4.7 and uncomment this. 4 | 5 | var x = Relay.QL` 6 | fragment on Node { 7 | ... { 8 | id 9 | } 10 | } 11 | `; 12 | */ -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/introspectionQueryForSchema.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query IntrospectionQueryForSchema { 3 | __schema { 4 | types { 5 | name 6 | } 7 | } 8 | } 9 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/introspectionQueryForType.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query IntrospectionQueryForType { 3 | __type(name: "Root") { 4 | name 5 | } 6 | } 7 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataConnection.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | friends(first: 3) { 7 | edges { 8 | node { 9 | name 10 | } 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataConnectionLimitable.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | viewer { 5 | configs { 6 | edges { 7 | node { 8 | name 9 | } 10 | } 11 | } 12 | } 13 | } 14 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataDynamic.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on NewsFeedConnection { 4 | edges { 5 | node { 6 | id 7 | ... on Story { 8 | attachments 9 | } 10 | } 11 | } 12 | } 13 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataGenerated.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) 5 | } 6 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataNonFindable.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | viewer { 5 | pendingPosts { 6 | count 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataPlural.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | websites 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataRequisite.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`fragment on Node { id }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/metadataVarArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | fragment on User { 4 | friends(orderby: $order) { 5 | count 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutation.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation { 4 | actorSubscribe(input: $input) { 5 | actor { 6 | profilePicture 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationBadSchemaMissingArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Your schema defines a mutation field `mutationMissingArg` that takes 0 arguments, but mutation fields must have exactly one argument named `input`.`` in file `mutationBadSchemaMissingArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationBadSchemaMissingArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation { 4 | mutationMissingArg 5 | } 6 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationBadSchemaWrongArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``Your schema defines a mutation field `mutationWrongArgs` that takes an argument named `foo`, but mutation fields must have exactly one argument named `input`.`` in file `mutationBadSchemaWrongArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationBadSchemaWrongArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation { 4 | mutationWrongArgs 5 | } 6 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationWithExtraArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('GraphQL validation error ``Unknown argument "extra" on field "actorSubscribe" of type "Mutation".`` in file `mutationWithExtraArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationWithExtraArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation MutationNameHere { 4 | actorSubscribe(input: $input, extra: $extra) { 5 | ${reference} 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationWithName.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation MutationNameHere { 4 | actorSubscribe(input: $input) { 5 | ${reference} 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/mutationWithoutArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation { 4 | actorSubscribe 5 | } 6 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/nonExistentMutation.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('GraphQL validation error ``Cannot query field "fakeMutation" on type "Mutation".`` in file `nonExistentMutation.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/nonExistentMutation.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | mutation { 4 | fakeMutation(input: $input) { 5 | actor { 6 | profilePicture 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/nonRootNodeField.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var fragment = function () { 3 | throw new Error('Relay transform error ``You defined a `node(id: Int)` field on type `InvalidType`, but Relay requires the `node` field to be defined on the root type. See the Object Identification Guide: \nhttp://facebook.github.io/relay/docs/graphql-object-identification.html`` in file `nonRootNodeField.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/nonRootNodeField.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var fragment = Relay.QL` 3 | fragment on InvalidType { 4 | node(id: 123) { 5 | ... on User { 6 | name 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/pluralField.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 456) { 5 | ... on Story { 6 | actors { 7 | id 8 | __typename 9 | } 10 | } 11 | } 12 | } 13 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithArrayObjectArg.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = Relay.QL` 3 | query { 4 | searchAll(queries: [$query]) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithArrayObjectNestedVariable.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = function () { 3 | throw new Error('Relay transform error ``Unexpected nested variable `query`; variables are supported as top-level arguments - `node(id: $id)` - or directly within lists - `nodes(ids: [$id])`.`` in file `queryWithArrayObjectNestedVariable.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithArrayObjectNestedVariable.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = Relay.QL` 3 | query { 4 | searchAll(queries: [{queryText: $query}]) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithArrayObjectValue.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = Relay.QL` 3 | query { 4 | searchAll(queries: [{queryText: "Relay"}]) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithBadDirective.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``You supplied a directive named `bad`, but no such directive exists.`` in file `queryWithBadDirective.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithBadDirective.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) @bad(if: $foo) { 5 | id 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithBadDirectiveArgs.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | throw new Error('Relay transform error ``You supplied a directive named `if`, but no such directive exists.`` in file `queryWithBadDirectiveArgs.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithBadDirectiveArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) @if(bad: $foo) { 5 | id 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithDirectives.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) @include(if: $foo) { 5 | ... on User @include(if: $bar) { 6 | name @skip(if: $baz) 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithFields.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | name 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithName.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query QueryNameHere { 4 | node(id: 123) { 5 | ... on User { 6 | profilePicture { 7 | uri 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithNestedFields.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ... on User { 6 | profilePicture { 7 | uri 8 | } 9 | } 10 | } 11 | } 12 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithNestedFragments.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | node(id: 123) { 5 | ${frag1} 6 | ${frag2} 7 | ${frag3} 8 | ${frag4} 9 | ... on User { 10 | profilePicture { 11 | uri 12 | ${frag5} 13 | ${frag6} 14 | ${frag7} 15 | ${frag8} 16 | } 17 | } 18 | ${frag9} 19 | ${frag10} 20 | ${frag11} 21 | ${frag12} 22 | } 23 | } 24 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithNullLiteral.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query MediaQuery { 4 | media(id: null) { 5 | ... on Story { 6 | id 7 | } 8 | } 9 | } 10 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithObjectArg.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = Relay.QL` 3 | query { 4 | search(query: $query) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithObjectArgNestedVariable.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = function () { 3 | throw new Error('Relay transform error ``Unexpected nested variable `query`; variables are supported as top-level arguments - `node(id: $id)` - or directly within lists - `nodes(ids: [$id])`.`` in file `queryWithObjectArgNestedVariable.input.txt`. Try updating your GraphQL schema if an argument/field/type was recently added.'); 4 | }(); 5 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithObjectArgNestedVariable.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = Relay.QL` 3 | query { 4 | search(query: {queryText: $query}) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithObjectArgValue.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('Relay'); 2 | var q = Relay.QL` 3 | query { 4 | search(query: {queryText: "Relay"}) { 5 | title 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithVarArgs.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | query { 4 | nodes(ids: [123,456]) { 5 | id 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithoutFields.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = function () { 3 | return { 4 | fieldName: 'viewer', 5 | kind: 'Query', 6 | metadata: {}, 7 | name: 'QueryWithoutFields', 8 | type: 'Viewer' 9 | }; 10 | }(); 11 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/queryWithoutFields.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL`query { viewer }`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/subscription.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = Relay.QL` 3 | subscription { 4 | likeStory(input: $input) { 5 | ${reference} 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/tagRelayClassicQL.input.txt: -------------------------------------------------------------------------------- 1 | var RelayClassic = require('react-relay/classic'); 2 | var x = RelayClassic.QL` 3 | query { 4 | node(id: 123) { 5 | id 6 | } 7 | } 8 | `; 9 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/tagRelayQL.input.txt: -------------------------------------------------------------------------------- 1 | var RelayQL = require('react-relay/RelayQL'); 2 | var x = RelayQL` 3 | query { 4 | node(id: 123) { 5 | id 6 | } 7 | } 8 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/templateString.golden.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = `Just a template string.`; 3 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/templateString.input.txt: -------------------------------------------------------------------------------- 1 | var Relay = require('react-relay'); 2 | var x = `Just a template string.`; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-classic/unionWithTypename.input.txt: -------------------------------------------------------------------------------- 1 | var foo = Relay.QL` 2 | query UnionWithTypename { 3 | media(id: 123) { 4 | __typename 5 | } 6 | } 7 | `; -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/error_confusing-fragment-name.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginGraphQL: Fragment `CompatProfile_data` should not end in `_data` to avoid conflict with a fragment named `CompatProfile` which also provides resulting data via the React prop `data`. Either rename this fragment to `CompatProfile` or choose a different prop name. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/error_confusing-fragment-name.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_data on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/error_too-many-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one fragment in the graphql tag referenced by the property user. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/error_unexpected-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one operation (query, mutation, or subscription) per graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/error_unexpected-operation.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected only fragments within this graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/error_unexpected-operation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | query Whoopsie { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/mutation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = graphql` 13 | mutation CompatCommentCreateMutation($input: CommentCreateInput!) { 14 | commentCreate(input: $input) { 15 | viewer { 16 | actor { 17 | id 18 | ...CompatProfilePic_user 19 | } 20 | } 21 | } 22 | } 23 | `; 24 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/no-fragment-spread.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: graphql` 16 | fragment CompatProfile_user on User { 17 | name 18 | } 19 | `, 20 | }); 21 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/no-object-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/no-object.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/query.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = graphql` 13 | query CompatViewerQuery($id: ID!, $scale: Float = 1.5) { 14 | node(id: $id) { 15 | ... on User { 16 | id 17 | ...CompatProfilePic_user 18 | } 19 | } 20 | } 21 | `; 22 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/simple-named-fragment.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | ...SomeOtherContainer 18 | } 19 | `); 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat-haste/simple-named-with-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/error_confusing-fragment-name.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginGraphQL: Fragment `CompatProfile_data` should not end in `_data` to avoid conflict with a fragment named `CompatProfile` which also provides resulting data via the React prop `data`. Either rename this fragment to `CompatProfile` or choose a different prop name. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/error_confusing-fragment-name.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_data on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/error_too-many-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one fragment in the graphql tag referenced by the property user. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/error_unexpected-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one operation (query, mutation, or subscription) per graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/error_unexpected-operation.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected only fragments within this graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/error_unexpected-operation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | query Whoopsie { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/mutation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = graphql` 13 | mutation CompatCommentCreateMutation($input: CommentCreateInput!) { 14 | commentCreate(input: $input) { 15 | viewer { 16 | actor { 17 | id 18 | ...CompatProfilePic_user 19 | } 20 | } 21 | } 22 | } 23 | `; 24 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/no-fragment-spread.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: graphql` 16 | fragment CompatProfile_user on User { 17 | name 18 | } 19 | `, 20 | }); 21 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/no-object-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/no-object.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/query.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = graphql` 13 | query CompatViewerQuery($id: ID!, $scale: Float = 1.5) { 14 | node(id: $id) { 15 | ... on User { 16 | id 17 | ...CompatProfilePic_user 18 | } 19 | } 20 | } 21 | `; 22 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/simple-named-fragment.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | ...SomeOtherContainer 18 | } 19 | `); 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-compat/simple-named-with-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/arguments-listvalue.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * @providesModule CompatProfile 4 | */ 5 | 6 | 'use strict'; 7 | 8 | const Relay = require('Relay'); 9 | 10 | const { graphql } = Relay; 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = Relay.createFragmentContainer(CompatProfile, { 15 | viewer: function () { 16 | return require('CompatProfile_viewer.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/error_confusing-fragment-name.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginGraphQL: Fragment `CompatProfile_data` should not end in `_data` to avoid conflict with a fragment named `CompatProfile` which also provides resulting data via the React prop `data`. Either rename this fragment to `CompatProfile` or choose a different prop name. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/error_confusing-fragment-name.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_data on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/error_too-many-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one fragment in the graphql tag referenced by the property user. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/error_unexpected-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one operation (query, mutation, or subscription) per graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/error_unexpected-operation.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected only fragments within this graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/error_unexpected-operation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | query Whoopsie { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/fragment-spread.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const CompatProfilePic = require('CompatProfilePic'); 10 | const RelayCompatContainer = require('RelayCompatContainer'); 11 | const graphql = require('graphql'); 12 | 13 | const CompatProfile = () => null; 14 | 15 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 16 | user: function () { 17 | return require('CompatProfile_user.graphql'); 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/memoize-inner-scope.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule SomeTopLevelView 5 | */ 6 | 7 | 'use strict'; 8 | 9 | var _graphql2; 10 | 11 | const ProfilePic = require('ProfilePic'); 12 | 13 | function SomeTopLevelView() { 14 | let _graphql = 'unrelated'; 15 | 16 | return 17 | 20 | ; 21 | } 22 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/module-operation.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatCommentCreateMutation 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = function () { 13 | return require('CompatCommentCreateMutation.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/multiple-root-fields.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = function () { 13 | return require('CompatViewerQuery.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/mutation.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = function () { 13 | return require('CompatCommentCreateMutation.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/mutation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = graphql` 13 | mutation CompatCommentCreateMutation($input: CommentCreateInput!) { 14 | commentCreate(input: $input) { 15 | viewer { 16 | actor { 17 | id 18 | ...CompatProfilePic_user 19 | } 20 | } 21 | } 22 | } 23 | `; 24 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/no-fragment-spread.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: function () { 16 | return require('CompatProfile_user.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/no-fragment-spread.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: graphql` 16 | fragment CompatProfile_user on User { 17 | name 18 | } 19 | `, 20 | }); 21 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/no-object-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/no-object.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: function () { 16 | return require('CompatProfile_user.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/no-object.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/query.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = function () { 13 | return require('CompatViewerQuery.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/query.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = graphql` 13 | query CompatViewerQuery($id: ID!, $scale: Float = 1.5) { 14 | node(id: $id) { 15 | ... on User { 16 | id 17 | ...CompatProfilePic_user 18 | } 19 | } 20 | } 21 | `; 22 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/simple-named-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | data: function () { 16 | return require('CompatProfile.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/simple-named-fragment.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | ...SomeOtherContainer 18 | } 19 | `); 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern-haste/simple-named-with-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/arguments-listvalue.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * @providesModule CompatProfile 4 | */ 5 | 6 | 'use strict'; 7 | 8 | const Relay = require('Relay'); 9 | 10 | const { graphql } = Relay; 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = Relay.createFragmentContainer(CompatProfile, { 15 | viewer: function () { 16 | return require('./__generated__/CompatProfile_viewer.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/error_confusing-fragment-name.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginGraphQL: Fragment `CompatProfile_data` should not end in `_data` to avoid conflict with a fragment named `CompatProfile` which also provides resulting data via the React prop `data`. Either rename this fragment to `CompatProfile` or choose a different prop name. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/error_confusing-fragment-name.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_data on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/error_too-many-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one fragment in the graphql tag referenced by the property user. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/error_unexpected-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected exactly one operation (query, mutation, or subscription) per graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/error_unexpected-operation.golden.txt: -------------------------------------------------------------------------------- 1 | ERROR: 2 | 3 | Error: unknown: BabelPluginRelay: Expected only fragments within this graphql tag. 4 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/error_unexpected-operation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | query Whoopsie { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/fragment-spread.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const CompatProfilePic = require('CompatProfilePic'); 10 | const RelayCompatContainer = require('RelayCompatContainer'); 11 | const graphql = require('graphql'); 12 | 13 | const CompatProfile = () => null; 14 | 15 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 16 | user: function () { 17 | return require('./__generated__/CompatProfile_user.graphql'); 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/memoize-inner-scope.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule SomeTopLevelView 5 | */ 6 | 7 | 'use strict'; 8 | 9 | var _graphql2; 10 | 11 | const ProfilePic = require('ProfilePic'); 12 | 13 | function SomeTopLevelView() { 14 | let _graphql = 'unrelated'; 15 | 16 | return 17 | 20 | ; 21 | } 22 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/module-operation.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatCommentCreateMutation 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = function () { 13 | return require('./__generated__/CompatCommentCreateMutation.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/multiple-root-fields.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = function () { 13 | return require('./__generated__/CompatViewerQuery.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/mutation.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = function () { 13 | return require('./__generated__/CompatCommentCreateMutation.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/mutation.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatCommentCreateMutation = graphql` 13 | mutation CompatCommentCreateMutation($input: CommentCreateInput!) { 14 | commentCreate(input: $input) { 15 | viewer { 16 | actor { 17 | id 18 | ...CompatProfilePic_user 19 | } 20 | } 21 | } 22 | } 23 | `; 24 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/no-fragment-spread.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: function () { 16 | return require('./__generated__/CompatProfile_user.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/no-fragment-spread.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: graphql` 16 | fragment CompatProfile_user on User { 17 | name 18 | } 19 | `, 20 | }); 21 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/no-object-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/no-object.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | user: function () { 16 | return require('./__generated__/CompatProfile_user.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/no-object.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile_user on User { 16 | name 17 | } 18 | `); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/query.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = function () { 13 | return require('./__generated__/CompatViewerQuery.graphql'); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/query.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule Compat 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const graphql = require('graphql'); 10 | const CompatProfilePic = require('CompatProfilePic'); 11 | 12 | const CompatViewerQuery = graphql` 13 | query CompatViewerQuery($id: ID!, $scale: Float = 1.5) { 14 | node(id: $id) { 15 | ... on User { 16 | id 17 | ...CompatProfilePic_user 18 | } 19 | } 20 | } 21 | `; 22 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/simple-named-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, { 15 | data: function () { 16 | return require('./__generated__/CompatProfile.graphql'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/simple-named-fragment.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | ...SomeOtherContainer 18 | } 19 | `); 20 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/__tests__/fixtures-modern/simple-named-with-many-fragments.input.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2004-present Facebook. All Rights Reserved. 3 | * 4 | * @providesModule CompatProfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const RelayCompatContainer = require('RelayCompatContainer'); 10 | const graphql = require('graphql'); 11 | 12 | const CompatProfile = () => null; 13 | 14 | module.exports = RelayCompatContainer.createContainer(CompatProfile, graphql` 15 | fragment CompatProfile on User { 16 | name 17 | } 18 | 19 | fragment CompatProfile_viewer on User { 20 | name 21 | } 22 | `); 23 | -------------------------------------------------------------------------------- /packages/babel-plugin-relay/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "babel-plugin-relay", 3 | "description": "A Babel Plugin for use with Relay applications.", 4 | "version": "1.0.1", 5 | "keywords": [ 6 | "graphql", 7 | "relay", 8 | "babel", 9 | "babel-plugin" 10 | ], 11 | "license": "BSD-3-Clause", 12 | "homepage": "https://facebook.github.io/relay/", 13 | "bugs": "https://github.com/facebook/relay/issues", 14 | "repository": "facebook/relay", 15 | "dependencies": { 16 | "graphql": "^0.10.1", 17 | "babel-runtime": "^6.23.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/react-relay/classic/__forks__/interface/RelayConnectionInterface.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @providesModule RelayConnectionInterface 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require('RelayOSSConnectionInterface'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/__forks__/interface/__mocks__/RelayConnectionInterface.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayConnectionInterface'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/__mocks__/Relay.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require('RelayPublic'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/__mocks__/RelayPublic.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayPublic'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/RelayContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayContainer'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/RelayContainerProxy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayContainerProxy'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/RelayContainerUtils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayContainerUtils'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/RelayPropTypes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayPropTypes'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/RelayReadyStateRenderer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('RelayReadyStateRenderer'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/getRelayQueries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const getRelayQueries = require.requireActual('getRelayQueries'); 15 | 16 | module.exports = jest.fn(getRelayQueries); 17 | -------------------------------------------------------------------------------- /packages/react-relay/classic/container/__mocks__/isRelayContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isRelayContainer'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/environment/__mocks__/isRelayContext.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isRelayContext'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/environment/__mocks__/isRelayEnvironment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isRelayEnvironment'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/environment/__mocks__/isRelayVariables.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isRelayVariables'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/interface/__mocks__/RelayNodeInterface.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayNodeInterface'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/interface/__mocks__/RelayOSSConnectionInterface.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayOSSConnectionInterface'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/legacy/mutation/__mocks__/GraphQLMutatorConstants.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('GraphQLMutatorConstants'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/legacy/store/__mocks__/generateClientEdgeID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('generateClientEdgeID'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/legacy/store/__mocks__/generateClientID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | let count = 1; 15 | 16 | const generateClientID = jest.fn(() => { 17 | return 'client:' + count++; 18 | }); 19 | 20 | module.exports = generateClientID; 21 | -------------------------------------------------------------------------------- /packages/react-relay/classic/legacy/store/__mocks__/generateForceIndex.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('generateForceIndex'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/legacy/store/__mocks__/recycleNodesInto.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | jest.unmock('recycleNodesInto'); 15 | 16 | module.exports = require('recycleNodesInto'); 17 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/RelayGraphQLMutation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayGraphQLMutation'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/RelayMutationQueue.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayMutationQueue'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/RelayMutationTransaction.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('RelayMutationTransaction'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/RelayMutationType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayMutationType'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/RelayOptimisticMutationUtils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayOptimisticMutationUtils'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/getRangeBehavior.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('getRangeBehavior'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/rangeOperationToMetadataKey.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('rangeOperationToMetadataKey'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/mutation/__mocks__/validateMutationConfig.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('validateMutationConfig'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/network-layer/default/__mocks__/RelayDefaultNetworkLayer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayDefaultNetworkLayer'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/network/__mocks__/RelayMutationRequest.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayMutationRequest'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/network/__mocks__/RelayQueryRequest.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQueryRequest'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/QueryBuilder.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('QueryBuilder'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayFragmentReference.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayFragmentReference'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayGraphQLTag.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayGraphQLTag'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayQueryPath.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const RelayQueryPath = require.requireActual('RelayQueryPath'); 15 | 16 | RelayQueryPath.fromJSON = jest.fn(RelayQueryPath.fromJSON); 17 | 18 | module.exports = RelayQueryPath; 19 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayQueryTransform.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQueryTransform'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayQueryVisitor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQueryVisitor'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayRefQueryDescriptor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayRefQueryDescriptor'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayRouteFragment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayRouteFragment'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayVariable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('RelayVariable'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/RelayVariables.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayVariables'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/buildRQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('buildRQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/callsFromGraphQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('callsFromGraphQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/callsToGraphQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('callsToGraphQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/createRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('createRelayQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/directivesToGraphQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('directivesToGraphQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/forEachRootCallArg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('forEachRootCallArg'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/fromGraphQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('fromGraphQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/fromGraphQLQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('fromGraphQLQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/generateConcreteFragmentID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('generateConcreteFragmentID'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/generateRQLFieldAlias.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('generateRQLFieldAlias')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/serializeRelayQueryCall.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('serializeRelayQueryCall'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/stableStringify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('stableStringify'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/query/__mocks__/toGraphQL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('toGraphQL'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/route/__mocks__/RelayMetaRoute.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayMetaRoute'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/RelayStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @providesModule RelayStore 10 | * @flow 11 | * @format 12 | */ 13 | 14 | 'use strict'; 15 | 16 | const RelayEnvironment = require('RelayEnvironment'); 17 | 18 | module.exports = new RelayEnvironment(); 19 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayCacheProcessor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayCacheProcessor'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayChangeTracker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayChangeTracker'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayFetchMode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayFetchMode'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayGarbageCollector.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayGarbageCollector'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayMutationTracker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayMutationTracker'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayQueryResultObservable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQueryResultObservable'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayQueryWriter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQueryWriter'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayReadyState.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = require.requireActual('RelayReadyState'); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayRecordStatusMap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayRecordStatusMap'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayRecordStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayRecordStore'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayRecordWriter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayRecordWriter'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayStore'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/RelayStoreData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayStoreData'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/filterExclusiveKeys.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('filterExclusiveKeys'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/isClassicRelayContext.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isClassicRelayContext'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/isClassicRelayEnvironment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isClassicRelayEnvironment'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/readRelayQueryData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const readRelayQueryData = require.requireActual('readRelayQueryData'); 15 | module.exports = jest.fn(readRelayQueryData); 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/restoreRelayCacheData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('restoreRelayCacheData'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/store/__mocks__/validateRelayReadQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const validateRelayReadQuery = require.requireActual('validateRelayReadQuery'); 15 | module.exports = validateRelayReadQuery; 16 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/RelayDeprecated.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayDeprecated'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/RelayError.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayError'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/RelayMetricsRecorder.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayMetricsRecorder'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/RelayQueryCaching.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayQueryCaching'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/configureForRelayOSS.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | global.__RELAYOSS__ = true; 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/isCompatibleRelayFragmentType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('isCompatibleRelayFragmentType'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/relayUnstableBatchedUpdates.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const relayUnstableBatchedUpdates = require('ReactDOM').unstable_batchedUpdates; 15 | 16 | module.exports = jest.fn(relayUnstableBatchedUpdates); 17 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__mocks__/testEditDistance.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('testEditDistance'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/__tests__/__snapshots__/RelayMockRenderer-test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`RelayMockRenderer renders a container with mock data 1`] = ` 4 |

5 | Zuck 6 |

7 | `; 8 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/relayUnstableBatchedUpdates.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @providesModule relayUnstableBatchedUpdates 10 | * @flow 11 | * @format 12 | */ 13 | 14 | 'use strict'; 15 | 16 | const ReactDOM = require('ReactDOM'); 17 | 18 | module.exports = ReactDOM.unstable_batchedUpdates; 19 | -------------------------------------------------------------------------------- /packages/react-relay/classic/tools/relayUnstableBatchedUpdates.native.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @providesModule relayUnstableBatchedUpdates 10 | * @format 11 | */ 12 | 13 | 'use strict'; 14 | 15 | const ReactNative = require('ReactNative'); 16 | 17 | module.exports = ReactNative.unstable_batchedUpdates; 18 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/checkRelayQueryData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('checkRelayQueryData')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/containsRelayQueryRootCall.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('containsRelayQueryRootCall'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/diffRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('diffRelayQuery')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/filterRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('filterRelayQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/findRelayQueryLeaves.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('findRelayQueryLeaves')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/flattenRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('flattenRelayQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/flattenSplitRelayQueries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('flattenSplitRelayQueries'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/intersectRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('intersectRelayQuery')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/printRelayOSSQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('printRelayOSSQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/printRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('printRelayQuery'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/splitDeferredRelayQueries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('splitDeferredRelayQueries')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/subtractRelayQuery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('subtractRelayQuery')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/transformRelayQueryPayload.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('transformRelayQueryPayload')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/writeRelayQueryPayload.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = jest.fn(require.requireActual('writeRelayQueryPayload')); 15 | -------------------------------------------------------------------------------- /packages/react-relay/classic/traversal/__mocks__/writeRelayUpdatePayload.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('writeRelayUpdatePayload'); 15 | -------------------------------------------------------------------------------- /packages/react-relay/modern/__tests__/__snapshots__/ReactRelayFragmentMockRenderer-test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`ReactRelayFragmentMockRenderer renders fragment containers with mock data as supplied as props 1`] = ` 4 |
5 |

6 | Mark 7 |

8 |

9 | 4 10 |

11 |
12 | `; 13 | -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/fragment.golden.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "kind": "Fragment", 4 | "directives": [], 5 | "metadata": null, 6 | "name": "myFragment", 7 | "selections": [ 8 | { 9 | "kind": "ScalarField", 10 | "alias": null, 11 | "args": [], 12 | "directives": [], 13 | "metadata": null, 14 | "name": "name", 15 | "type": "String" 16 | } 17 | ], 18 | "type": "User", 19 | "argumentDefinitions": [] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/fragment.input.rql: -------------------------------------------------------------------------------- 1 | fragment myFragment on User { 2 | name 3 | } -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/ignores-fixme-fat-interface.golden.txt: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/ignores-fixme-fat-interface.input.rql: -------------------------------------------------------------------------------- 1 | fragment myFragment on User { 2 | id 3 | likers @fixme_fat_interface 4 | } -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/ignores-relay-pattern-directive.golden.txt: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/ignores-relay-pattern-directive.input.rql: -------------------------------------------------------------------------------- 1 | fragment myFragment on User @relay(pattern: true) { 2 | id 3 | likers 4 | } -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/include-directive.input.rql: -------------------------------------------------------------------------------- 1 | fragment myFragment on User { 2 | actor @include(if: $conditional) { 3 | id 4 | } 5 | } -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/skip-directive.input.rql: -------------------------------------------------------------------------------- 1 | fragment myFragment on User { 2 | actor @skip(if: $conditional) { 3 | id 4 | } 5 | } -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/skip-invalid.golden.txt: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /packages/relay-compiler/codegen/flowtype/__tests__/fixtures/relay-flow-parser/skip-invalid.input.rql: -------------------------------------------------------------------------------- 1 | fragment myFragment on NotAType { 2 | id 3 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/__snapshots__/RelayValidator-test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`id alias validation 1`] = `"RelayValidator: Relay does not allow aliasing fields to \`id\`. This name is reserved for the globally unique \`id\` field on \`Node\`."`; 4 | 5 | exports[`non-scalar leaf 1`] = ` 6 | "You supplied a GraphQL document with validation errors: 7 | test.graphql: Field \\"friends\\" of type \\"FriendsConnection\\" must have a selection of subfields. Did you mean \\"friends { ... }\\"?" 8 | `; 9 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/code-generator/linked-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends") { 3 | count 4 | } 5 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/code-generator/scalar-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment ScalarHandleField on User { 2 | name @__clientField(handle: "clientName") 3 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/connection.input.rql: -------------------------------------------------------------------------------- 1 | query NodeQuery($id: ID!) { 2 | node(id: $id) { 3 | id 4 | ... on Story { 5 | comments(first: 10) @connection(key: "NodeQuery_comments") { 6 | edges { 7 | node { 8 | actor { 9 | name 10 | friends(first: 10) @connection(key: "NodeQuery_friends") { 11 | edges { 12 | node { 13 | name 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/linked-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | query LinkedHandleField($id: ID!) { 2 | node(id: $id) { 3 | ... on User { 4 | friends(first: 10) @__clientField(handle: "clientFriends") { 5 | count 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/plural-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | { 2 | "argumentDefinitions": [], 3 | "kind": "Fragment", 4 | "metadata": { 5 | "plural": true 6 | }, 7 | "name": "PluralFragment", 8 | "selections": [ 9 | { 10 | "kind": "ScalarField", 11 | "alias": null, 12 | "args": null, 13 | "name": "name", 14 | "storageKey": null 15 | } 16 | ], 17 | "type": "User" 18 | } 19 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/plural-fragment.input.rql: -------------------------------------------------------------------------------- 1 | fragment PluralFragment on User @relay(plural: true) { 2 | name 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/scalar-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | query ScalarHandleField($id: ID!) { 2 | node(id: $id) { 3 | ... on User { 4 | name @__clientField(handle: "clientName") 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/unions.input.rql: -------------------------------------------------------------------------------- 1 | query UnionQuery { 2 | maybeNode { 3 | ... on NonNode { 4 | name 5 | } 6 | ... on Story { 7 | id 8 | body { 9 | text 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/compiler/viewer-query.input.rql: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer { 3 | actor { 4 | id 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/filter-context/kitchen-sink.golden.txt: -------------------------------------------------------------------------------- 1 | query MainQuery { 2 | me { 3 | ...Bar 4 | } 5 | } 6 | 7 | fragment Bar on User { 8 | ...Baz 9 | } 10 | 11 | fragment Baz on User { 12 | id 13 | } 14 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/filter-context/kitchen-sink.input.rql: -------------------------------------------------------------------------------- 1 | query UnusedQuery { 2 | me { 3 | ...Bar 4 | ...UnusedFragment 5 | } 6 | } 7 | 8 | fragment UnusedFragment on User { 9 | name 10 | } 11 | 12 | query MainQuery { 13 | me { 14 | ...Bar 15 | } 16 | } 17 | 18 | fragment Bar on User { 19 | ...Baz 20 | } 21 | 22 | fragment Baz on User { 23 | id 24 | } 25 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/conditional.golden.txt: -------------------------------------------------------------------------------- 1 | export type ConditionField = {| 2 | +id?: string; 3 | |}; 4 | 5 | export type NestedCondition = {| 6 | +id?: string; 7 | |}; 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/conditional.input.rql: -------------------------------------------------------------------------------- 1 | fragment ConditionField on Node { 2 | id @include(if: $condition) 3 | } 4 | 5 | fragment NestedCondition on Node { 6 | ... @include(if: $condition) { 7 | id 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/fragment-spread.golden.txt: -------------------------------------------------------------------------------- 1 | export type InlineFragment = {| 2 | +id: string; 3 | +profilePicture: ?{| |}; 4 | |}; 5 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/fragment-spread.input.rql: -------------------------------------------------------------------------------- 1 | fragment InlineFragment on Node { 2 | id 3 | ...OtherFragment 4 | profilePicture { 5 | ...PictureFragment 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/linked-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment LinkedField on User { 2 | profilePicture { 3 | uri 4 | width 5 | height 6 | } 7 | hometown { 8 | # object 9 | id 10 | profilePicture { 11 | uri 12 | } 13 | } 14 | actor { 15 | # interface 16 | id 17 | } 18 | } 19 | 20 | query UnionTypeTest { 21 | neverNode { 22 | __typename 23 | ... on FakeNode { 24 | id 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/mutation-input-has-array.golden.txt: -------------------------------------------------------------------------------- 1 | export type InputHasArrayVariables = {| 2 | input?: ?{ 3 | clientMutationId?: ?string; 4 | storyIds?: ?$ReadOnlyArray; 5 | }; 6 | |}; 7 | 8 | export type InputHasArrayResponse = {| 9 | +viewerNotificationsUpdateAllSeenState: ?{| 10 | +stories: ?$ReadOnlyArray; 13 | |}; 14 | |}; 15 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/mutation-input-has-array.input.rql: -------------------------------------------------------------------------------- 1 | mutation InputHasArray($input: UpdateAllSeenStateInput) { 2 | viewerNotificationsUpdateAllSeenState(input: $input) { 3 | stories { 4 | actorCount 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/mutation.golden.txt: -------------------------------------------------------------------------------- 1 | export type CommentCreateMutationVariables = {| 2 | input: { 3 | clientMutationId?: ?string; 4 | feedbackId?: ?string; 5 | }; 6 | first?: ?number; 7 | orderBy?: ?$ReadOnlyArray; 8 | |}; 9 | 10 | export type CommentCreateMutationResponse = {| 11 | +commentCreate: ?{| 12 | +comment: ?{| 13 | +id: string; 14 | +name: ?string; 15 | +friends: ?{| 16 | +count: ?number; 17 | |}; 18 | |}; 19 | |}; 20 | |}; 21 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/mutation.input.rql: -------------------------------------------------------------------------------- 1 | mutation CommentCreateMutation( 2 | $input: CommentCreateInput! 3 | $first: Int 4 | $orderBy: [String!] 5 | ) { 6 | commentCreate(input: $input) { 7 | comment { 8 | id 9 | name 10 | friends(first: $first, orderby: $orderBy) { 11 | count 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/plural-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | export type PluralFragment = $ReadOnlyArray<{| 2 | +id: string; 3 | |}>; 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/plural-fragment.input.rql: -------------------------------------------------------------------------------- 1 | fragment PluralFragment on Node @relay(plural: true) { 2 | id 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/roots.input.rql: -------------------------------------------------------------------------------- 1 | query ExampleQuery { 2 | me { 3 | id 4 | } 5 | } 6 | 7 | fragment ExampleFragment on User { 8 | id 9 | } 10 | 11 | mutation TestMutation($input: CommentCreateInput!) { 12 | commentCreate(input: $input) { 13 | comment { 14 | id 15 | } 16 | } 17 | } 18 | 19 | subscription TestSubscription($input: FeedbackLikeInput) { 20 | feedbackLikeSubscribe(input: $input) { 21 | feedback { 22 | id 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/scalar-field.golden.txt: -------------------------------------------------------------------------------- 1 | export type ScalarField = {| 2 | +id: string; 3 | +name: ?string; 4 | +websites: ?$ReadOnlyArray; 5 | +traits: ?$ReadOnlyArray; 6 | +aliasedLinkedField: ?{| 7 | +aliasedField: ?number; 8 | |}; 9 | +screennames: ?$ReadOnlyArray; 13 | |}; 14 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/flow-generator/scalar-field.input.txt: -------------------------------------------------------------------------------- 1 | fragment ScalarField on User { 2 | id 3 | name 4 | websites 5 | traits 6 | aliasedLinkedField: birthdate { 7 | aliasedField: year 8 | } 9 | screennames { 10 | name 11 | service 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/directive-generic.input.rql: -------------------------------------------------------------------------------- 1 | fragment TestFragment on User { 2 | id @customDirective(level: 11) 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/directive-include.input.rql: -------------------------------------------------------------------------------- 1 | fragment TestFragment on User { 2 | id @include(if: $Cond) 3 | ... on User @include(if: $Cond) { 4 | firstName 5 | } 6 | ...Foo @include(if: $Cond) 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/field-arguments.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery { 2 | task(number: 123) { 3 | title 4 | } 5 | settings(environment: WEB) { 6 | notificationSounds 7 | } 8 | checkinSearchQuery(query: {query: "Relay"}) { 9 | query 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/fragment-with-arguments.input.rql: -------------------------------------------------------------------------------- 1 | fragment TestFragment on User @argumentDefinitions( 2 | id: {type: "ID", nonNull: true} 3 | ) { 4 | profilePicture(size: $PictureSize) { 5 | uri 6 | } 7 | ...Foo @arguments(localId: $id) 8 | } 9 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/inline-untyped-fragment.input.rql: -------------------------------------------------------------------------------- 1 | fragment InlineUntypedFragment on User { 2 | ... { 3 | name 4 | } 5 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/linked-handle-field-with-filters.input.ql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10, orderby: $orderby) @__clientField(handle: "clientFriends", filters: ["first", "orderby"]) { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/linked-handle-field-with-key.input.ql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends", key: "LinkedHandleField_friends") { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/linked-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends") @__clientField(handle: "otherFriends") { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/linked-handle-filter.input.ql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends", filters: ["first"]) @__clientField(handle: "otherFriends") { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/list-argument.input.rql: -------------------------------------------------------------------------------- 1 | query ListArgumentQuery($waypoint: WayPoint!) { 2 | route(waypoints: [$waypoint, { 3 | lat: "0.0" 4 | lon: "0.0" 5 | }]) { 6 | steps { 7 | note 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/list-of-enums.golden.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "kind": "Fragment", 4 | "directives": [], 5 | "metadata": null, 6 | "name": "TestFragment", 7 | "selections": [ 8 | { 9 | "kind": "ScalarField", 10 | "alias": null, 11 | "args": [], 12 | "directives": [], 13 | "metadata": null, 14 | "name": "traits", 15 | "type": "[PersonalityTraits]" 16 | } 17 | ], 18 | "type": "User", 19 | "argumentDefinitions": [] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/list-of-enums.input.rql: -------------------------------------------------------------------------------- 1 | fragment TestFragment on User { 2 | traits # This is a list of enums. 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/literal-list-argument.input.rql: -------------------------------------------------------------------------------- 1 | query LiteralListArgumentQuery { 2 | route(waypoints: [{ 3 | lat: "0.0" 4 | lon: "0.0" 5 | }]) { 6 | steps { 7 | note 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/literal-object-argument.input.rql: -------------------------------------------------------------------------------- 1 | query LiteralObjectArgument { 2 | checkinSearchQuery(query: { 3 | query: "Facebook" 4 | }) { 5 | query 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/object-argument.input.rql: -------------------------------------------------------------------------------- 1 | query ObjectArgument($text: String!) { 2 | checkinSearchQuery(query: { 3 | query: $text 4 | }) { 5 | query 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/scalar-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment ScalarHandleField on User { 2 | name @__clientField(handle: "clientName") @__clientField(handle: "clientName2") 3 | } -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/simple-fragment.golden.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "kind": "Fragment", 4 | "directives": [], 5 | "metadata": null, 6 | "name": "TestFragment", 7 | "selections": [ 8 | { 9 | "kind": "ScalarField", 10 | "alias": null, 11 | "args": [], 12 | "directives": [], 13 | "metadata": null, 14 | "name": "id", 15 | "type": "ID!" 16 | } 17 | ], 18 | "type": "User", 19 | "argumentDefinitions": [] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/simple-fragment.input.rql: -------------------------------------------------------------------------------- 1 | fragment TestFragment on User { 2 | id 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/core/__tests__/fixtures/parser/simple-query.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery($id: ID!) { 2 | foo: node(id: $id) { 3 | id 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/connection/__tests__/fixtures/connection-transform/connection-with-variables.input.rql: -------------------------------------------------------------------------------- 1 | fragment Example on User { 2 | friends( 3 | first: $friendsFirst 4 | after: $friendsAfter 5 | ) @connection(key: "Example_friends") { 6 | edges { 7 | node { 8 | profilePicture(preset: $preset) { 9 | uri 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/connection/__tests__/fixtures/connection-transform/invalid-type.golden.txt: -------------------------------------------------------------------------------- 1 | RelayConnectionTransform: Expected field `actors: [Actor]` to have a first or last argument in document `NodeQuery`. 2 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/connection/__tests__/fixtures/connection-transform/invalid-type.input.rql: -------------------------------------------------------------------------------- 1 | query NodeQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ... on Story { 7 | actors @connection { 8 | name 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/connection/__tests__/fixtures/connection-transform/missing-first-arg.golden.txt: -------------------------------------------------------------------------------- 1 | RelayConnectionTransform: Expected field `comments: CommentsConnection` to have a first or last argument in document `NodeQuery`. 2 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/connection/__tests__/fixtures/connection-transform/missing-first-arg.input.rql: -------------------------------------------------------------------------------- 1 | query NodeQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ... on Story { 7 | comments @connection { 8 | edges { 9 | node { 10 | actor { 11 | name 12 | } 13 | } 14 | } 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/mutation-with-handle.golden.txt: -------------------------------------------------------------------------------- 1 | mutation ViewerMutation( 2 | $input: CommentCreateInput! 3 | ) { 4 | commentCreate(input: $input) { 5 | viewer @__clientField(handle: "otherViewer") @__clientField(handle: "viewer") { 6 | actor { 7 | id 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/mutation-with-handle.input.rql: -------------------------------------------------------------------------------- 1 | mutation ViewerMutation($input: CommentCreateInput!) { 2 | commentCreate(input: $input) { 3 | viewer @__clientField(handle: "otherViewer") @__clientField(handle: "viewer") { 4 | actor { 5 | id 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/mutation.golden.txt: -------------------------------------------------------------------------------- 1 | mutation ViewerMutation( 2 | $input: CommentCreateInput! 3 | ) { 4 | commentCreate(input: $input) { 5 | viewer @__clientField(handle: "viewer") { 6 | actor { 7 | id 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/mutation.input.rql: -------------------------------------------------------------------------------- 1 | mutation ViewerMutation($input: CommentCreateInput!) { 2 | commentCreate(input: $input) { 3 | viewer { 4 | actor { 5 | id 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/query-with-handle.golden.txt: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer @__clientField(handle: "otherViewer") @__clientField(handle: "viewer") { 3 | actor { 4 | id 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/query-with-handle.input.rql: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer @__clientField(handle: "otherViewer") @__clientField(handle: "viewer") { 3 | actor { 4 | id 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/query.golden.txt: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer @__clientField(handle: "viewer") { 3 | actor { 4 | id 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/handlers/viewer/__tests__/fixtures/viewer-handle-transform/query.input.rql: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer { 3 | actor { 4 | id 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/apply-fragment-argument-transform/deletes-unreferenced-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/apply-fragment-argument-transform/deletes-unreferenced-fragments.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery($id: ID!) { 2 | node(id: $id) { 3 | id 4 | } 5 | } 6 | 7 | fragment UnreferencedFragment on User { 8 | id 9 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/apply-fragment-argument-transform/merges-identical-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | $pictureSize: [Int] = [128] 4 | ) { 5 | node(id: $id) { 6 | id 7 | ...Profile_4CNNX6 8 | ...ProfileFriends 9 | } 10 | } 11 | 12 | fragment Profile_4CNNX6 on User { 13 | profilePicture(size: $pictureSize) { 14 | uri 15 | } 16 | } 17 | 18 | fragment ProfileFriends on User { 19 | friends(first: 10) { 20 | edges { 21 | node { 22 | ...Profile_4CNNX6 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/auto-alias-transform/auto-aliases-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | $count: Int! 4 | ) { 5 | root_1EgSXo: node(id: $id) { 6 | id 7 | friends_2gKal7: friends(first: $count) { 8 | edges { 9 | node { 10 | id 11 | pic_2Ubw83: profilePicture(size: 32) { 12 | uri 13 | } 14 | } 15 | } 16 | } 17 | recentFriends_4z9fUO: friends(first: $count, orderby: "recent") { 18 | edges { 19 | node { 20 | id 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/auto-alias-transform/auto-aliases-fields.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery($id: ID!, $count: Int!) { 2 | root: node(id: $id) { 3 | _id: id 4 | friends(first: $count) { 5 | edges { 6 | node { 7 | id 8 | pic: profilePicture(size: 32) { 9 | uri 10 | } 11 | } 12 | } 13 | } 14 | recentFriends: friends(first: $count, orderby: "recent") { 15 | edges { 16 | node { 17 | id 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/field-handle-transform/linked-handle-field-filter.golden.txt: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends: __friends_clientFriends(first: 10, orderby: $orderby) { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/field-handle-transform/linked-handle-field-filter.input.ql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10, orderby: $orderby) @__clientField(handle: "clientFriends", filters: ["first", "orderby"]) { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/field-handle-transform/linked-handle-field.golden.txt: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends: __friends_clientFriends { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/field-handle-transform/linked-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends") { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/field-handle-transform/scalar-handle-field.golden.txt: -------------------------------------------------------------------------------- 1 | fragment ScalarHandleField on User { 2 | name: __name_clientName 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/field-handle-transform/scalar-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment ScalarHandleField on User { 2 | name @__clientField(handle: "clientName") 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/filter-directives-transform/directives.golden.txt: -------------------------------------------------------------------------------- 1 | query SampleQuery( 2 | $gk: Boolean! 3 | $id: ID! 4 | ) { 5 | node(id: $id) { 6 | ... on User { 7 | id 8 | name @include(if: $gk) 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/filter-directives-transform/directives.input.rql: -------------------------------------------------------------------------------- 1 | query SampleQuery( 2 | $gk: Boolean! 3 | $id: ID! 4 | ) { 5 | node(id: $id) { 6 | ... on User { 7 | # The @exampleFilteredDirective directive is defined as an extension, so 8 | # will get stripped. 9 | id @exampleFilteredDirective 10 | 11 | # The @include directive is defined in the base schema, so survives. 12 | name @include(if: $gk) 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-errors/flatten-same-alias-different-args.golden.txt: -------------------------------------------------------------------------------- 1 | Invariant Violation: RelayFlattenTransform: Expected all fields with the alias `{"directives":[],"field":"friends"}` to have the same name/arguments. Got `friends([{"kind":"Argument","metadata":null,"name":"first","value":{"kind":"Literal","metadata":null,"value":10},"type":"Int"}])` and `friends([{"kind":"Argument","metadata":null,"name":"first","value":{"kind":"Literal","metadata":null,"value":5},"type":"Int"}])`. 2 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-errors/flatten-same-alias-different-args.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ... on User { 7 | friends(first: 5) { 8 | count 9 | } 10 | } 11 | ... on User { 12 | friends(first: 10) { 13 | edges { 14 | node { 15 | id 16 | } 17 | } 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-abstract/flatten-abstract-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | ... on User { 6 | id 7 | firstName 8 | surname: lastName 9 | friends(first: 10) { 10 | edges { 11 | node { 12 | firstName 13 | lastName 14 | } 15 | cursor 16 | } 17 | } 18 | lastName 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-conditions/flatten-conditions.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) @skip(if: $cond) { 4 | node(id: $id) { 5 | ... on User { 6 | id 7 | firstName 8 | surname: lastName 9 | friends(first: 10) { 10 | edges { 11 | node { 12 | firstName 13 | } 14 | } 15 | } 16 | } 17 | } 18 | viewer { 19 | ... on Node { 20 | id 21 | } 22 | ... on User { 23 | name 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-inline/flatten-inline-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | name 7 | friends(first: 10) { 8 | edges { 9 | node { 10 | id 11 | name 12 | } 13 | } 14 | } 15 | moreFriends: friends(first: 20) { 16 | edges { 17 | node { 18 | id 19 | name 20 | } 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-spreads/inlines-nested-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ... on User { 7 | id 8 | firstName 9 | lastName 10 | profilePicture(size: 128) { 11 | uri 12 | } 13 | friends(first: 10) { 14 | edges { 15 | node { 16 | firstName 17 | lastName 18 | profilePicture(size: 128) { 19 | uri 20 | } 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-spreads/inlines-nested-fragments.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ...ProfileWithFriends 7 | } 8 | } 9 | 10 | fragment ProfileWithFriends on User { 11 | id 12 | firstName 13 | lastName 14 | ...ProfileWithoutFriends 15 | friends(first: 10) { 16 | edges { 17 | node { 18 | ...ProfileWithoutFriends 19 | } 20 | } 21 | } 22 | } 23 | 24 | fragment ProfileWithoutFriends on User { 25 | firstName 26 | lastName 27 | profilePicture(size: 128) { 28 | uri 29 | } 30 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-spreads/merges-aliased-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | $size: Int! 4 | ) { 5 | node(id: $id) { 6 | ... on User { 7 | id 8 | firstName 9 | profilePicture(size: 64) { 10 | uri 11 | } 12 | aliasedPic: profilePicture(size: 64) { 13 | uri 14 | } 15 | varPic: profilePicture(size: $size) { 16 | uri 17 | } 18 | lastName 19 | } 20 | id 21 | __typename 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-spreads/merges-unaliased-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ... on User { 7 | id 8 | profilePicture(size: 128) { 9 | uri 10 | } 11 | friends(first: 10) { 12 | edges { 13 | node { 14 | id 15 | profilePicture(size: 128) { 16 | uri 17 | } 18 | } 19 | } 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform-option-flatten-spreads/merges-unaliased-fields.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | id 6 | ...ProfilePicture 7 | ...ProfileFriends 8 | } 9 | } 10 | 11 | fragment ProfilePicture on User { 12 | id 13 | profilePicture(size: 128) { 14 | uri 15 | } 16 | } 17 | 18 | fragment ProfileFriends on User { 19 | id 20 | friends(first: 10) { 21 | edges { 22 | node { 23 | ...ProfilePicture 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform/linked-handle-field.golden.txt: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends") @__clientField(handle: "recentFriends") { 3 | count 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform/linked-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment LinkedHandleField on User { 2 | friends(first: 10) @__clientField(handle: "clientFriends") { 3 | count 4 | } 5 | ... on User { 6 | # should be de-duped 7 | friends(first: 10) @__clientField(handle: "clientFriends") { 8 | count 9 | } 10 | ... on User { 11 | friends(first: 10) @__clientField(handle: "recentFriends") { 12 | count 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform/scalar-handle-field.golden.txt: -------------------------------------------------------------------------------- 1 | fragment ScalarHandleField on User { 2 | name @__clientField(handle: "otherClientName") @__clientField(handle: "clientName") 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/flatten-transform/scalar-handle-field.input.rql: -------------------------------------------------------------------------------- 1 | fragment ScalarHandleField on User { 2 | name @__clientField(handle: "clientName") 3 | ... on User { 4 | # should be de-duped 5 | name @__clientField(handle: "clientName") 6 | ... on User { 7 | name @__clientField(handle: "otherClientName") 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/generate-requisite-fields-transform/abstract-plural.golden.txt: -------------------------------------------------------------------------------- 1 | query CommentQuery { 2 | node(id: "comment") { 3 | __typename 4 | ... on Comment { 5 | actors { 6 | __typename 7 | id 8 | } 9 | } 10 | id 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/generate-requisite-fields-transform/abstract-plural.input.rql: -------------------------------------------------------------------------------- 1 | query CommentQuery { 2 | node(id: "comment") { 3 | ... on Comment { 4 | actors { 5 | id 6 | } 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/generate-requisite-fields-transform/node-union.golden.txt: -------------------------------------------------------------------------------- 1 | query UnionQuery { 2 | maybeNode { 3 | __typename 4 | ... on NonNode { 5 | name 6 | } 7 | ... on Node { 8 | id 9 | } 10 | ... on FakeNode { 11 | id 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/generate-requisite-fields-transform/node-union.input.rql: -------------------------------------------------------------------------------- 1 | query UnionQuery { 2 | maybeNode { 3 | # ... on Node { id } is autogenerated here because Node is a possible type 4 | ... on NonNode { 5 | name 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/generate-requisite-fields-transform/non-node-union.golden.txt: -------------------------------------------------------------------------------- 1 | query UnionQuery { 2 | neverNode { 3 | __typename 4 | ... on NonNode { 5 | name 6 | } 7 | ... on FakeNode { 8 | id 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/generate-requisite-fields-transform/non-node-union.input.rql: -------------------------------------------------------------------------------- 1 | query UnionQuery { 2 | neverNode { 3 | # ... on Node { id } is not autogenerated here since no concrete type 4 | # implements Node 5 | ... on NonNode { 6 | name 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/relay-directive-transform/plural-fragment.golden.txt: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Fragment", 3 | "directives": [], 4 | "metadata": { 5 | "plural": true 6 | }, 7 | "name": "PluralFragment", 8 | "selections": [ 9 | { 10 | "kind": "ScalarField", 11 | "alias": null, 12 | "args": [], 13 | "directives": [], 14 | "metadata": null, 15 | "name": "name", 16 | "type": "String" 17 | } 18 | ], 19 | "type": "User", 20 | "argumentDefinitions": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/relay-directive-transform/plural-fragment.input.rql: -------------------------------------------------------------------------------- 1 | fragment PluralFragment on User @relay(plural: true) { 2 | name 3 | } 4 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-client-field-transform/client-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query BestFriendsQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | ...BestFriends 6 | } 7 | } 8 | 9 | fragment BestFriends on User { 10 | id 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-handle-field-transform/mutation-with-handle.golden.txt: -------------------------------------------------------------------------------- 1 | mutation ViewerMutation( 2 | $input: CommentCreateInput! 3 | ) { 4 | commentCreate(input: $input) { 5 | viewer { 6 | actor { 7 | id 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-handle-field-transform/mutation-with-handle.input.rql: -------------------------------------------------------------------------------- 1 | mutation ViewerMutation($input: CommentCreateInput!) { 2 | commentCreate(input: $input) { 3 | viewer @__clientField(handle: "otherViewer") @__clientField(handle: "viewer") { 4 | actor { 5 | id 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-handle-field-transform/query-with-handle.golden.txt: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer { 3 | actor { 4 | id 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-handle-field-transform/query-with-handle.input.rql: -------------------------------------------------------------------------------- 1 | query ViewerQuery { 2 | viewer @__clientField(handle: "otherViewer") @__clientField(handle: "viewer") { 3 | actor { 4 | id 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/dont-skip-different-ids.golden.txt: -------------------------------------------------------------------------------- 1 | query DontSkipDifferentIds { 2 | viewer { 3 | actor { 4 | id 5 | hometown { 6 | id 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/dont-skip-different-ids.input.rql: -------------------------------------------------------------------------------- 1 | query DontSkipDifferentIds { 2 | viewer { 3 | actor { 4 | id 5 | hometown { 6 | id # id of a different parent field, can't skip 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/dont-skip-nested-fields-across-fragments.golden.txt: -------------------------------------------------------------------------------- 1 | query DontSkipNestedFieldsAcrossFragments { 2 | viewer { 3 | actor { 4 | hometown { 5 | id 6 | } 7 | ... on User { 8 | hometown { 9 | name 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/dont-skip-nested-fields-across-fragments.input.rql: -------------------------------------------------------------------------------- 1 | query DontSkipNestedFieldsAcrossFragments { 2 | viewer { 3 | actor { 4 | hometown { 5 | id 6 | } 7 | ... on User { 8 | hometown { 9 | name # keep: not yet fetched 10 | } 11 | } 12 | ... on User { 13 | hometown { 14 | id # skip: fetched by parent 15 | name # skip: fetched by sibling 16 | } 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/skip-nested-linked-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query SkipNestedLinkedFields { 2 | viewer { 3 | actor { 4 | hometown { 5 | name 6 | } 7 | ... on User { 8 | hometown { 9 | id 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/skip-nested-linked-fields.input.rql: -------------------------------------------------------------------------------- 1 | query SkipNestedLinkedFields { 2 | viewer { 3 | actor { 4 | hometown { 5 | name 6 | } 7 | ... on User { 8 | hometown { 9 | name # skip: fetched by parent 10 | } 11 | } 12 | ... on User { 13 | hometown { 14 | id # keep: not yet fetched 15 | name # skip: fetched by parent 16 | } 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/skips-nested-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query SkipNestedFields { 2 | viewer { 3 | actor { 4 | id 5 | ... on Actor { 6 | name 7 | ... on User { 8 | lastName 9 | } 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/skips-nested-fields.input.rql: -------------------------------------------------------------------------------- 1 | query SkipNestedFields { 2 | viewer { 3 | actor { 4 | id 5 | ... on Actor { 6 | name 7 | ... on User { 8 | name # skip, fetched by parent 9 | lastName 10 | # Note that this fragment would also be flattend by the 11 | # FlattenTransform since the outer/inner types match 12 | ... on User { 13 | lastName # skip, fetched by parent 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/skips-with-outer-fields-first.golden.txt: -------------------------------------------------------------------------------- 1 | query SkipWithOuterFieldFirst( 2 | $cond: Boolean 3 | $notCond: Boolean 4 | ) { 5 | viewer { 6 | actor { 7 | id 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-redundant-nodes-transform/skips-with-outer-fields-last.golden.txt: -------------------------------------------------------------------------------- 1 | query SkipWithOuterFieldLast( 2 | $cond: Boolean 3 | $notCond: Boolean 4 | ) { 5 | viewer { 6 | actor { 7 | id 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-unreachable-node-transform/keeps-other-fields.golden.txt: -------------------------------------------------------------------------------- 1 | query TestQuery( 2 | $cond: Boolean 3 | ) { 4 | viewer { 5 | actor { 6 | id @skip(if: $cond) 7 | ... on User @include(if: $cond) { 8 | name 9 | firstName 10 | } 11 | ...UserFragment @include(if: $cond) 12 | } 13 | } 14 | } 15 | 16 | fragment UserFragment on User { 17 | name 18 | } 19 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-unreachable-node-transform/keeps-other-fields.input.rql: -------------------------------------------------------------------------------- 1 | query TestQuery($cond: Boolean) { 2 | viewer { 3 | actor { 4 | id @skip(if: $cond) 5 | ... on User @include(if: $cond) { 6 | name @include(if: true) @skip(if: false) 7 | firstName @include(if: true) @skip(if: false) 8 | } 9 | ...UserFragment @include(if: $cond) 10 | } 11 | } 12 | } 13 | 14 | fragment UserFragment on User { 15 | name 16 | } 17 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-unreachable-node-transform/removes-include-false.golden.txt: -------------------------------------------------------------------------------- 1 | query EmptyQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | ...SkippedFragment 6 | } 7 | } 8 | 9 | query TestQuery { 10 | viewer { 11 | actor { 12 | name 13 | ...SkippedFragment 14 | } 15 | } 16 | } 17 | 18 | fragment SkippedFragment on User @argumentDefinitions( 19 | cond: {type: "Boolean!", defaultValue: false} 20 | ) { 21 | id @include(if: $cond) 22 | } 23 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/skip-unreachable-node-transform/removes-skip-true.golden.txt: -------------------------------------------------------------------------------- 1 | query EmptyQuery( 2 | $id: ID! 3 | ) { 4 | node(id: $id) { 5 | ...SkippedFragment 6 | } 7 | } 8 | 9 | query TestQuery { 10 | viewer { 11 | actor { 12 | name 13 | ...SkippedFragment 14 | } 15 | } 16 | } 17 | 18 | fragment SkippedFragment on User @argumentDefinitions( 19 | cond: {type: "Boolean!", defaultValue: true} 20 | ) { 21 | id @skip(if: $cond) 22 | } 23 | -------------------------------------------------------------------------------- /packages/relay-compiler/transforms/__tests__/fixtures/strip-unused-variables-transform/kitchen-sink.golden.txt: -------------------------------------------------------------------------------- 1 | fragment TestFragment on Actor { 2 | id @skip(if: $usedInDirective) 3 | } 4 | 5 | query TestQuery( 6 | $usedInDirective: Boolean! 7 | $usedInCall: ID! 8 | ) { 9 | node(id: $usedInCall) { 10 | ...TestFragment 11 | } 12 | } 13 | 14 | query TestQuery2( 15 | $usedInTestQuery2: Boolean! 16 | ) { 17 | node(id: 4) { 18 | ... on Actor { 19 | id @skip(if: $usedInTestQuery2) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/relay-runtime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "relay-runtime", 3 | "description": "A core runtime for building GraphQL-driven applications.", 4 | "version": "1.0.0", 5 | "keywords": [ 6 | "graphql", 7 | "relay" 8 | ], 9 | "license": "BSD-3-Clause", 10 | "homepage": "https://facebook.github.io/relay/", 11 | "bugs": "https://github.com/facebook/relay/issues", 12 | "repository": "facebook/relay", 13 | "dependencies": { 14 | "babel-runtime": "^6.23.0", 15 | "fbjs": "^0.8.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/relay-runtime/store/__mocks__/RelayRecordState.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @format 10 | */ 11 | 12 | 'use strict'; 13 | 14 | module.exports = require.requireActual('RelayRecordState'); 15 | -------------------------------------------------------------------------------- /packages/relay-runtime/util/RelayDefaultHandleKey.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @providesModule RelayDefaultHandleKey 10 | * @flow 11 | * @format 12 | */ 13 | 14 | 'use strict'; 15 | 16 | module.exports = { 17 | DEFAULT_HANDLE_KEY: '', 18 | }; 19 | -------------------------------------------------------------------------------- /scripts/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "fbjs" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /scripts/jest/environment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | 'use strict'; 11 | 12 | require('babel-runtime/regenerator'); 13 | -------------------------------------------------------------------------------- /website-prototyping-tools/playground.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {%= o.htmlWebpackPlugin.options.title %} 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /website/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Start in website/ even if run from root directory 6 | cd "$(dirname "$0")" 7 | 8 | cd ../../relay-gh-pages 9 | # git checkout -- . 10 | # git clean -dfx 11 | # git fetch 12 | # git rebase 13 | rm -Rf * 14 | cd ../relay/website 15 | node server/generate.js 16 | cp -R build/relay/* ../../relay-gh-pages/ 17 | rm -Rf build/ 18 | cd ../../relay-gh-pages 19 | # git add --all 20 | # git commit -m "update website" 21 | # git push 22 | # cd ../relay/website 23 | -------------------------------------------------------------------------------- /website/src/elements/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/relay/b79b085ac00e62f8343d555fc2648885ee845643/website/src/elements/favicon/favicon.ico -------------------------------------------------------------------------------- /website/src/relay/img/Guides-Containers-HOC-Relay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/relay/b79b085ac00e62f8343d555fc2648885ee845643/website/src/relay/img/Guides-Containers-HOC-Relay.png -------------------------------------------------------------------------------- /website/src/relay/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/relay/b79b085ac00e62f8343d555fc2648885ee845643/website/src/relay/img/favicon.png --------------------------------------------------------------------------------