From 7ecf1dcc13f1b05ba00f0744f70ec4b510dc1dc4 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 9 Dec 2025 21:52:13 -0800 Subject: [PATCH 1/6] Switch to markdown filenames --- .prettierignore | 1 + src/tests/TestRunner.ts | 2 +- ...y.json.expected => empty.json.expected.md} | 0 ...ted => experimentalField.json.expected.md} | 0 ...ed => invlaidKey.invalid.json.expected.md} | 0 ...ected => multiLineHeader.json.expected.md} | 0 ...ltiLineNonHeader.invalid.json.expected.md} | 0 ...lableFieldIsNull.invalid.json.expected.md} | 0 ...ferencesNonGqlType.invalid.ts.expected.md} | 0 ...d => ArgWithNoType.invalid.ts.expected.md} | 0 ...=> ArgumentWithDescription.ts.expected.md} | 0 ...ncIterableArgument.invalid.ts.expected.md} | 0 ...ed => CustomScalarArgument.ts.expected.md} | 0 ...cted => DeprecatedArgument.ts.expected.md} | 0 ...edRequiredArgument.invalid.ts.expected.md} | 0 ...GqlTypeUsedAsPositionalArg.ts.expected.md} | 0 ...TypedAsTypeLiteral.invalid.ts.expected.md} | 0 ...=> NoArgsWithNever.invalid.ts.expected.md} | 0 ... NoArgsWithUnknown.invalid.ts.expected.md} | 0 ...> NoTypeAnnotation.invalid.ts.expected.md} | 0 ...ableArgumentErrors.invalid.ts.expected.md} | 0 ...ected => NullableArguments.ts.expected.md} | 0 ...ectLiteralArgument.invalid.ts.expected.md} | 0 ...d => OpaqueArgType.invalid.ts.expected.md} | 0 ...pected => OptionalArgument.ts.expected.md} | 0 ...onNullableArgument.invalid.ts.expected.md} | 0 ...ullableArgumentWithDefault.ts.expected.md} | 0 ...sitionalArgAndArgs.invalid.ts.expected.md} | 0 ...ionalArgDeprecatedOptional.ts.expected.md} | 0 ...alArgDeprecatedWithDefault.ts.expected.md} | 0 ...d => PositionalArgOptional.ts.expected.md} | 0 ...ptionalNotNullable.invalid.ts.expected.md} | 0 ...> PositionalArgWithDefault.ts.expected.md} | 0 ...sitionalArgWithDescription.ts.expected.md} | 0 ...=> PromiseArgument.invalid.ts.expected.md} | 0 ...expected => StringArgument.ts.expected.md} | 0 ...pleLiteralArgument.invalid.ts.expected.md} | 0 ....ts.expected => FloatField.ts.expected.md} | 0 ...=> FloatFieldAliasedImport.ts.expected.md} | 0 ...eld.ts.expected => IdField.ts.expected.md} | 0 ...ld.ts.expected => IntField.ts.expected.md} | 0 ...blockCommentThreeStars.invalid.ts.expected | 13 ------ ...ckCommentThreeStars.invalid.ts.expected.md | 0 ...ntFollowsDecorator.invalid.ts.expected.md} | 0 ...tachedBlockComment.invalid.ts.expected.md} | 0 ...otJSDocWithoutStar.invalid.ts.expected.md} | 0 ...WithInvalidTagName.invalid.ts.expected.md} | 0 ...entWithKillsParent.invalid.ts.expected.md} | 0 ...CommentWithoutStar.invalid.ts.expected.md} | 0 ...idTagInLinecomment.invalid.ts.expected.md} | 0 ...ted => lineComment.invalid.ts.expected.md} | 0 ...CommentWrongCasing.invalid.ts.expected.md} | 0 ...nJSDocBlockComment.invalid.ts.expected.md} | 0 ...rIsArrayWithNumber.invalid.ts.expected.md} | 0 ...mportModuleSpecifierEnding.ts.expected.md} | 0 ...cted => invalidKey.invalid.ts.expected.md} | 0 ...ultipleInvalidKeys.invalid.ts.expected.md} | 0 ... nonNullableIsNull.invalid.ts.expected.md} | 0 ...cted => DefineCustomScalar.ts.expected.md} | 0 ...ustomScalarWithDescription.ts.expected.md} | 0 ... DefineRenamedCustomScalar.ts.expected.md} | 0 ...ts.expected => SpecifiedBy.ts.expected.md} | 0 ...yMissingUrlinvalid.invalid.ts.expected.md} | 0 ...ecifiedByOldSyntax.invalid.ts.expected.md} | 0 ... SpecifiedByOnEnum.invalid.ts.expected.md} | 0 ...ttachedToWrongNode.invalid.ts.expected.md} | 0 ...ed => DefaultArgumentArray.ts.expected.md} | 0 ...ArrayValuesInvalid.invalid.ts.expected.md} | 0 ...aultArgumentBooleanLiteral.ts.expected.md} | 0 ...DefaultArgumentNullLiteral.ts.expected.md} | 0 ...faultArgumentNumberLiteral.ts.expected.md} | 0 ...faultArgumentObjectLiteral.ts.expected.md} | 0 ...ynamicPropertyName.invalid.ts.expected.md} | 0 ...teralInterpolation.invalid.ts.expected.md} | 0 ...iplePropertyErrors.invalid.ts.expected.md} | 0 ...bjectLiteralSpread.invalid.ts.expected.md} | 0 ...efaultArgumentPropertyName.ts.expected.md} | 0 ...faultArgumentStringLiteral.ts.expected.md} | 0 ...mentStringLiteralBackticks.ts.expected.md} | 0 ...kticksInterpolated.invalid.ts.expected.md} | 0 ...iteralDefaultValue.invalid.ts.expected.md} | 0 ...cContextDependency.invalid.ts.expected.md} | 0 ...ependencyWithChain.invalid.ts.expected.md} | 0 ...erivedContextChain.invalid.ts.expected.md} | 0 ...ontextNoReturnType.invalid.ts.expected.md} | 0 ...NonNamedReturnType.invalid.ts.expected.md} | 0 ...edContextUsedMultipleTimes.ts.expected.md} | 0 ...edContextsSameType.invalid.ts.expected.md} | 0 ...ed => simpleDerivedContext.ts.expected.md} | 0 ...simpleDerivedContextNoArgs.ts.expected.md} | 0 ...extReadsRandomType.invalid.ts.expected.md} | 0 ...ntextUndefinedType.invalid.ts.expected.md} | 0 ...lankLinesAroundDescription.ts.expected.md} | 0 ...=> BlankLinesFollowTypeTag.ts.expected.md} | 0 ...tionFollowsTypeTag.invalid.ts.expected.md} | 0 ...ionOnLineOfTypeTag.invalid.ts.expected.md} | 0 .../DescriptionWithGitHubHandle.ts.expected | 40 ------------------- ...DescriptionWithGitHubHandle.ts.expected.md | 0 ...ed => MultilineDescription.ts.expected.md} | 0 ...lowedByDescription.invalid.ts.expected.md} | 0 ...d => defineCustomDirective.ts.expected.md} | 0 ...veAdditionalArgsAreIgnored.ts.expected.md} | 0 ...CustomDirectiveArgsIsNever.ts.expected.md} | 0 ...eCustomDirectiveCustomName.ts.expected.md} | 0 ...iveLocationInvalid.invalid.ts.expected.md} | 0 ...DirectiveMultipleLocations.ts.expected.md} | 0 ...irectiveNoLocation.invalid.ts.expected.md} | 0 ...ctiveOnIsNotString.invalid.ts.expected.md} | 0 ...ectiveReadsContext.invalid.ts.expected.md} | 0 ...eCustomDirectiveRepeatable.ts.expected.md} | 0 ...ineCustomDirectiveWithArgs.ts.expected.md} | 0 ...DirectiveWithArgsNonScalar.ts.expected.md} | 0 ...rectiveWithArgsWithDefault.ts.expected.md} | 0 ...iveArgFieldInvalid.invalid.ts.expected.md} | 0 ...iveArgInvalidOneOf.invalid.ts.expected.md} | 0 ...IsStringLiteralWithDefault.ts.expected.md} | 0 ... directiveNotConst.invalid.ts.expected.md} | 0 ...ectiveOnArgumentDefinition.ts.expected.md} | 0 ...xpected => directiveOnEnum.ts.expected.md} | 0 ...ed => directiveOnEnumValue.ts.expected.md} | 0 ...directiveOnFieldDefinition.ts.expected.md} | 0 ...tiveOnInputFieldDefinition.ts.expected.md} | 0 ...directiveOnInputObjectType.ts.expected.md} | 0 ...ed => directiveOnInterface.ts.expected.md} | 0 ...d => directiveOnObjectType.ts.expected.md} | 0 ...ected => directiveOnScalar.ts.expected.md} | 0 ...pected => directiveOnUnion.ts.expected.md} | 0 ...sedWithInvalidArgs.invalid.ts.expected.md} | 0 ...iveWithSyntaxError.invalid.ts.expected.md} | 0 ...qlAnnotateOnNonGqlDocblock.ts.expected.md} | 0 ...dDirectiveWithArgs.invalid.ts.expected.md} | 0 ...efinedDirectiveWithoutArgs.ts.expected.md} | 0 ...d => DeprecatedEnumVariant.ts.expected.md} | 0 .../{Enum.ts.expected => Enum.ts.expected.md} | 0 ...ected => EnumFromUnionType.ts.expected.md} | 0 ...nionTypeNotLiteral.invalid.ts.expected.md} | 0 ...peNotStringLiteral.invalid.ts.expected.md} | 0 ...omUnionTypeOfStringLiteral.ts.expected.md} | 0 ...omUnionTypeWithDescription.ts.expected.md} | 0 ...ithEmitEnumsConfig.invalid.ts.expected.md} | 0 ...NotValidIdentifier.invalid.ts.expected.md} | 0 ...umValuesDifferentThanNames.ts.expected.md} | 0 ...ted => EnumWithDescription.ts.expected.md} | 0 ...WithVariantWithDescription.ts.expected.md} | 0 ...licitlyNumericEnum.invalid.ts.expected.md} | 0 ...ithEmitEnumsConfig.invalid.ts.expected.md} | 0 ...licitlyNumericEnum.invalid.ts.expected.md} | 0 ...cted => NonNullEnumDefault.ts.expected.md} | 0 ...llEnumDefaultInInputObject.ts.expected.md} | 0 ... NonNullPluralEnumDefaults.ts.expected.md} | 0 ...ed => NonNullTsEnumDefault.ts.expected.md} | 0 ...TsEnumDefaultStringLiteral.ts.expected.md} | 0 ...lowedWithEmitEnums.invalid.ts.expected.md} | 0 ....ts.expected => playground.ts.expected.md} | 0 ...adme.ts.expected => readme.ts.expected.md} | 0 ...dStringFieldToEnum.invalid.ts.expected.md} | 0 ... addStringFieldToInterface.ts.expected.md} | 0 ...faceImplementedByInterface.ts.expected.md} | 0 ...ldToInterfaceTwice.invalid.ts.expected.md} | 0 ...ingFieldToNonGrats.invalid.ts.expected.md} | 0 ...istsOnConcreteType.invalid.ts.expected.md} | 0 ...lementingInterface.invalid.ts.expected.md} | 0 ...cted => addDeprecatedField.ts.expected.md} | 0 ...d => addFieldWithArguments.ts.expected.md} | 0 ...=> addFieldWithDescription.ts.expected.md} | 0 ... addRenamedFieldToSomeType.ts.expected.md} | 0 ...> addStringFieldToSomeType.ts.expected.md} | 0 ....expected => defaultExport.ts.expected.md} | 0 ...AsArrowFunctionLet.invalid.ts.expected.md} | 0 ...unctionNotExported.invalid.ts.expected.md} | 0 ...AsArrowFunctionVar.invalid.ts.expected.md} | 0 ...eldAsExportedArrowFunction.ts.expected.md} | 0 ...rrowFunctionPositionalArgs.ts.expected.md} | 0 ...ExportedAsyncArrowFunction.ts.expected.md} | 0 ...dMultipleVariables.invalid.ts.expected.md} | 0 ...dAsExportedNothing.invalid.ts.expected.md} | 0 ...ldAsExportedNumber.invalid.ts.expected.md} | 0 ...OnTypeDefinedWithInterface.ts.expected.md} | 0 ...interfaceFirstArgumentType.ts.expected.md} | 0 ...ssingFirstArgument.invalid.ts.expected.md} | 0 ...gFirstArgumentType.invalid.ts.expected.md} | 0 ...sFirstArgumentType.invalid.ts.expected.md} | 0 ...LFirstArgumentType.invalid.ts.expected.md} | 0 ...ted => notExported.invalid.ts.expected.md} | 0 ...ected => optionalModelType.ts.expected.md} | 0 ...d => DeprecatedMethodField.ts.expected.md} | 0 ...=> DeprecatedPropertyField.ts.expected.md} | 0 ...d => FieldAsSetter.invalid.ts.expected.md} | 0 ...> FieldAsStaticClassMethod.ts.expected.md} | 0 ...ethodInNestedScope.invalid.ts.expected.md} | 0 ...edScopeButExported.invalid.ts.expected.md} | 0 ...sMethodNotExported.invalid.ts.expected.md} | 0 ...icClassMethodOnNonGqlClass.ts.expected.md} | 0 ...MethodOnUnnamedNonGqlClass.ts.expected.md} | 0 ...odWithClassAsDefaultExport.ts.expected.md} | 0 ...efinedOnNonGqlType.invalid.ts.expected.md} | 0 ...ldOnArbitraryParam.invalid.ts.expected.md} | 0 ...TagOnIncorrectNode.invalid.ts.expected.md} | 0 ...ionOfMultipleTypes.invalid.ts.expected.md} | 0 ...xpected => GetAcessorField.ts.expected.md} | 0 ...odFieldMissingType.invalid.ts.expected.md} | 0 ...MethodSignatureOnInterface.ts.expected.md} | 0 ...FieldsAsStaticClassMethods.ts.expected.md} | 0 ... => ParameterPropertyField.ts.expected.md} | 0 ...ieldBindingPattern.invalid.ts.expected.md} | 0 ...terPropertyFieldDeprecated.ts.expected.md} | 0 ...rtyFieldNoModifier.invalid.ts.expected.md} | 0 ...ropertyFieldNoType.invalid.ts.expected.md} | 0 ...meterPropertyFieldReadOnly.ts.expected.md} | 0 ...eldReadOnlyPrivate.invalid.ts.expected.md} | 0 ...ameterPropertyFieldRenamed.ts.expected.md} | 0 ...opertyFieldWithDescription.ts.expected.md} | 0 ...tectedFieldMethods.invalid.ts.expected.md} | 0 ...tyFieldMissingType.invalid.ts.expected.md} | 0 ...ected => PublicFieldMethod.ts.expected.md} | 0 ...enceNonGraphQLType.invalid.ts.expected.md} | 0 ...renceUndefinedType.invalid.ts.expected.md} | 0 ...s.expected => RenamedField.ts.expected.md} | 0 ...ed => RenamedFieldWithArgs.ts.expected.md} | 0 ...enamedFieldWithDescription.ts.expected.md} | 0 ...StringFieldWithDescription.ts.expected.md} | 0 ...onFieldNotExported.invalid.ts.expected.md} | 0 ....ts.expected => ArrayField.ts.expected.md} | 0 ...xpected => ArrayOfPromises.ts.expected.md} | 0 ...ted => ArrayShorthandField.ts.expected.md} | 0 ... => ArrayWithNullableItems.ts.expected.md} | 0 ...ected => AsyncPromiseField.ts.expected.md} | 0 ...s.expected => BooleanField.ts.expected.md} | 0 ...s.expected => CustomScalar.ts.expected.md} | 0 ...=> DuplicateFields.invalid.ts.expected.md} | 0 ...sNotMatchInterface.invalid.ts.expected.md} | 0 ...ts.expected => KitchenSink.ts.expected.md} | 0 ...ts.expected => LinkedField.ts.expected.md} | 0 ... => LinkedFieldWithTypeArg.ts.expected.md} | 0 ...s.expected => MaybePromise.ts.expected.md} | 0 ...expected => OptionalFields.ts.expected.md} | 0 ...pected => OptionalProperty.ts.expected.md} | 0 ...sParentOnException.invalid.ts.expected.md} | 0 ...ected => ParenthesizedType.ts.expected.md} | 0 ...pected => PromiseOfPromise.ts.expected.md} | 0 ...cted => ReadonlyArrayField.ts.expected.md} | 0 ...ts.expected => RenamedType.ts.expected.md} | 0 ...d => RenamedTypeOutOfOrder.ts.expected.md} | 0 ...ts.expected => StringField.ts.expected.md} | 0 ...ieldKillsParentOnException.ts.expected.md} | 0 ...leByDefaultEnables.invalid.ts.expected.md} | 0 ....ts.expected => UnionField.ts.expected.md} | 0 ...cted => NonNullablePromise.ts.expected.md} | 0 ...xpected => NullablePromise.ts.expected.md} | 0 ...rayPassedToGeneric.invalid.ts.expected.md} | 0 ...=> complexMutualReferences.ts.expected.md} | 0 ....ts.expected => connection.ts.expected.md} | 0 ...=> connectionEdgeAsGeneric.ts.expected.md} | 0 ...ed => defineFieldOnGeneric.ts.expected.md} | 0 .../{edge.ts.expected => edge.ts.expected.md} | 0 ...=> enumWithGeneric.invalid.ts.expected.md} | 0 ...pected => genericInputType.ts.expected.md} | 0 ...pected => genericInterface.ts.expected.md} | 0 ...expected => genericOverArg.ts.expected.md} | 0 ...ericReferencedMoreThanOnce.ts.expected.md} | 0 ...eUsedAsUnionMember.invalid.ts.expected.md} | 0 ...MemberViaTypeParam.invalid.ts.expected.md} | 0 ...d => genericTypeUsingClass.ts.expected.md} | 0 ... genericTypeUsingInterface.ts.expected.md} | 0 ...gGqlGenericTypeArg.invalid.ts.expected.md} | 0 ...ected => multiparamGeneric.ts.expected.md} | 0 ...pected => skippedTypeParam.ts.expected.md} | 0 ...ppedTypeParamPassesLiteral.ts.expected.md} | 0 ...eToInputType.input.invalid.ts.expected.md} | 0 ...ncingMethodGeneric.invalid.ts.expected.md} | 0 ...sult.ts.expected => result.ts.expected.md} | 0 ...PassedAsGenericArg.invalid.ts.expected.md} | 0 ...arPassedAsNonGqlGenericArg.ts.expected.md} | 0 ...ected => scalarWithGeneric.ts.expected.md} | 0 ...rfaceFromTypeParam.invalid.ts.expected.md} | 0 ...mplementsInterface.invalid.ts.expected.md} | 0 ...> genericTypeMemberOfUnion.ts.expected.md} | 0 ...edAsGenericTypeArg.invalid.ts.expected.md} | 0 ....expected => customHeaders.ts.expected.md} | 0 ...xpected => multilineHeader.ts.expected.md} | 0 ...=> oneOfDeprecated.invalid.ts.expected.md} | 0 ...ed => oneOfFieldIsNullable.ts.expected.md} | 0 ...ed => oneOfFieldIsOptional.ts.expected.md} | 0 ...singTypeAnnotation.invalid.ts.expected.md} | 0 ...cted => oneOfFieldTypeList.ts.expected.md} | 0 ...eOfFieldTypeListOfNullable.ts.expected.md} | 0 ...ieldTypeNotGraphQL.invalid.ts.expected.md} | 0 ...rHasMultipleFields.invalid.ts.expected.md} | 0 ...OfMemberHasNoField.invalid.ts.expected.md} | 0 ...onMemberNotLiteral.invalid.ts.expected.md} | 0 ... oneOfWithFieldDescription.ts.expected.md} | 0 ...hFieldDescriptionInsideObj.ts.expected.md} | 0 ...> oneOfWithTypeDescription.ts.expected.md} | 0 ...ts.expected => simpleOneOf.ts.expected.md} | 0 ...OneOfDeprecatedTag.invalid.ts.expected.md} | 0 ...erencedInInputType.invalid.ts.expected.md} | 0 ...eprecatedInputType.invalid.ts.expected.md} | 0 ...e.ts.expected => InputType.ts.expected.md} | 0 ...cted => InputTypeInterface.ts.expected.md} | 0 ...eInterfaceFunction.invalid.ts.expected.md} | 0 ...ypeInterfaceMethod.invalid.ts.expected.md} | 0 ...TypeInterfaceOptionalField.ts.expected.md} | 0 ...erfacePromiseField.invalid.ts.expected.md} | 0 ...ypeMergedInterface.invalid.ts.expected.md} | 0 ... => InputTypeOptionalField.ts.expected.md} | 0 ...erencingOutputType.invalid.ts.expected.md} | 0 ...eReturnedFromField.invalid.ts.expected.md} | 0 ...putTypeWithDeprecatedField.ts.expected.md} | 0 ...catedRequiredField.invalid.ts.expected.md} | 0 ...> InputTypeWithDescription.ts.expected.md} | 0 ...utTypeWithFieldDescription.ts.expected.md} | 0 ...pected => RenamedInputType.ts.expected.md} | 0 ...tFieldWithGqlField.invalid.ts.expected.md} | 0 ...d => FieldReturnsInterface.ts.expected.md} | 0 ...ed => IgnoresExtendsClause.ts.expected.md} | 0 ...ted => ImplementsInterface.ts.expected.md} | 0 ...entsInterfaceWithTypeParam.ts.expected.md} | 0 ...plementsMultipleInterfaces.ts.expected.md} | 0 ...ImplementsRenamedInterface.ts.expected.md} | 0 ...initionExtendsGqlInterface.ts.expected.md} | 0 ... InterfaceExtendsInterface.ts.expected.md} | 0 ...erfaceFieldWithDescription.ts.expected.md} | 0 ...riptionThatDiffersFromType.ts.expected.md} | 0 ...terfaceImplementsInterface.ts.expected.md} | 0 ...aceMergedIntoClass.invalid.ts.expected.md} | 0 ...nterfaceMergedIntoNode.invalid.ts.expected | 25 ------------ ...rfaceMergedIntoNode.invalid.ts.expected.md | 0 ... InterfaceMergedIntoObject.ts.expected.md} | 0 ...rfaceMissingFields.invalid.ts.expected.md} | 0 ...=> InterfaceWithCustomName.ts.expected.md} | 0 ...terfaceWithDeprecatedField.ts.expected.md} | 0 ...> InterfaceWithDescription.ts.expected.md} | 0 ...> MergedInterfaces.invalid.ts.expected.md} | 0 ...ttachedToWrongNode.invalid.ts.expected.md} | 0 ...endInterfaceWithNonGqlType.ts.expected.md} | 0 ...outTypeOrInterface.invalid.ts.expected.md} | 0 ...d => fieldOnScalar.invalid.ts.expected.md} | 0 ...ted => genericType.invalid.ts.expected.md} | 0 ...> genericTypeField.invalid.ts.expected.md} | 0 ...ected => inputType.invalid.ts.expected.md} | 0 ... => inputTypeField.invalid.ts.expected.md} | 0 ...ected => interface.invalid.ts.expected.md} | 0 ...formedEntitySyntax.invalid.ts.expected.md} | 0 ...d => notFoundField.invalid.ts.expected.md} | 0 ...ed => notFoundType.invalid.ts.expected.md} | 0 ...s.expected => type.invalid.ts.expected.md} | 0 ...ected => typeField.invalid.ts.expected.md} | 0 ... fieldFollowedByDeprecated.ts.expected.md} | 0 ...lassMethodWithContextValue.ts.expected.md} | 0 ...odWithContextValueExported.ts.expected.md} | 0 ...textValueInArgsPos.invalid.ts.expected.md} | 0 ... => ContextValueBeforeArgs.ts.expected.md} | 0 ...singTypeAnnotation.invalid.ts.expected.md} | 0 ...ed => ContextValueOptional.ts.expected.md} | 0 ...d => ContextValueReadTwice.ts.expected.md} | 0 ...ContextValueSpread.invalid.ts.expected.md} | 0 ...alueTypeNotDefined.invalid.ts.expected.md} | 0 ...extValueTypedAsAny.invalid.ts.expected.md} | 0 ...tValueTypedAsNever.invalid.ts.expected.md} | 0 ...alueTypedAsUnknown.invalid.ts.expected.md} | 0 ...> FunctionWithContextValue.ts.expected.md} | 0 ...odsReferencingContextValue.ts.expected.md} | 0 ...eContextValuesUsed.invalid.ts.expected.md} | 0 ...> ClassMethodWithInfoValue.ts.expected.md} | 0 ...d => FunctionWithInfoValue.ts.expected.md} | 0 ... StaticMethodWithInfoValue.ts.expected.md} | 0 ...sNotMatchInterface.invalid.ts.expected.md} | 0 ...xpected => semanticNonNull.ts.expected.md} | 0 ...sNotMatchInterface.invalid.ts.expected.md} | 0 ...ticNonNullMatchesInterface.ts.expected.md} | 0 ...s.expected => semanticNull.ts.expected.md} | 0 ...eWithAsyncIterable.invalid.ts.expected.md} | 0 ...InterfaceWithAsyncIterable.ts.expected.md} | 0 ...tionClassWithAsyncIterable.ts.expected.md} | 0 ...sWithAsyncIterable.invalid.ts.expected.md} | 0 ...tionFieldWithAsyncIterable.ts.expected.md} | 0 ...WithVariantWithDescription.ts.expected.md} | 0 ...d => RedefineBuiltinScalar.ts.expected.md} | 0 ...ts.expected => userExample.ts.expected.md} | 0 ....ts.expected => queryField.ts.expected.md} | 0 ...queryFieldOnMethod.invalid.ts.expected.md} | 0 ...> queryFieldOnStaticMethod.ts.expected.md} | 0 ...ected => queryFieldRenamed.ts.expected.md} | 0 ...WithExplicitlyDefinedQuery.ts.expected.md} | 0 ...FirstArgParentType.invalid.ts.expected.md} | 0 ....ts.expected => rootFields.ts.expected.md} | 0 ...ldNotAsyncIterable.invalid.ts.expected.md} | 0 ...sImplementsNonGqlInterface.ts.expected.md} | 0 ...ClassMissingFields.invalid.ts.expected.md} | 0 ...ed => ClassWithDescription.ts.expected.md} | 0 ...thDescriptionAndCustomName.ts.expected.md} | 0 ... ClassWithoutAName.invalid.ts.expected.md} | 0 ...ed => QueryAsClass.invalid.ts.expected.md} | 0 ...ts.expected => RenamedType.ts.expected.md} | 0 ...RenamedTypeHasDash.invalid.ts.expected.md} | 0 ...RenamedTypeNewLine.invalid.ts.expected.md} | 0 ...peStartsWithNumber.invalid.ts.expected.md} | 0 ...peWithoutClassName.invalid.ts.expected.md} | 0 ...ttachedToWrongNode.invalid.ts.expected.md} | 0 ...initionImplementsInterface.ts.expected.md} | 0 ...eWithDeprecatedTag.invalid.ts.expected.md} | 0 ...plementsMultipleInterfaces.ts.expected.md} | 0 ...sIsArrayNotLiteral.invalid.ts.expected.md} | 0 ...IsNumberNotLiteral.invalid.ts.expected.md} | 0 ... AliasOfUnknownDefinesType.ts.expected.md} | 0 ...e.ts.expected => AliasType.ts.expected.md} | 0 ...mplementsInterface.invalid.ts.expected.md} | 0 ...ed => AliasWithDescription.ts.expected.md} | 0 ...thDescriptionAndCustomName.ts.expected.md} | 0 ...eryAsAliasOfObject.invalid.ts.expected.md} | 0 ...AsAliasOfUndefined.invalid.ts.expected.md} | 0 ...d => QueryAsAliasOfUnknown.ts.expected.md} | 0 ...ts.expected => RenamedType.ts.expected.md} | 0 ....expected => InterfaceType.ts.expected.md} | 0 ...aceTypeExtendsGqlInterface.ts.expected.md} | 0 ...eWithDeprecatedTag.invalid.ts.expected.md} | 0 ...aceTypeImplementsInterface.ts.expected.md} | 0 ...> InterfaceWithDescription.ts.expected.md} | 0 ...thDescriptionAndCustomName.ts.expected.md} | 0 ...QueryFromInterface.invalid.ts.expected.md} | 0 ...ts.expected => RenamedType.ts.expected.md} | 0 ...ttachedToWrongNode.invalid.ts.expected.md} | 0 ...torMissingTypename.invalid.ts.expected.md} | 0 ... => MethodTypename.invalid.ts.expected.md} | 0 ... PropertySignatureTypename.ts.expected.md} | 0 ...enameIncorrectName.invalid.ts.expected.md} | 0 ...ypenameMissingType.invalid.ts.expected.md} | 0 ...nameNonLiteralType.invalid.ts.expected.md} | 0 ...pected => PropertyTypename.ts.expected.md} | 0 ...sNotMatchClassName.invalid.ts.expected.md} | 0 ...tMatchDeclaredName.invalid.ts.expected.md} | 0 ...oBeDeclaredAsConst.invalid.ts.expected.md} | 0 ...aredAsExactlyConst.invalid.ts.expected.md} | 0 ...enameNoInitializer.invalid.ts.expected.md} | 0 ...nStringInitializer.invalid.ts.expected.md} | 0 ...berMissingTypename.invalid.ts.expected.md} | 0 ...ed => DefineUnionOfOneType.ts.expected.md} | 0 ...xpected => DefineUnionType.ts.expected.md} | 0 ...ontainingInterface.invalid.ts.expected.md} | 0 ...ferencingInputType.invalid.ts.expected.md} | 0 ...ReferencingLiteral.invalid.ts.expected.md} | 0 ...ineUnionTypeWithInterfaces.ts.expected.md} | 0 ...eUnionTypeWithTypeLiterals.ts.expected.md} | 0 ...onAsMemberOfItself.invalid.ts.expected.md} | 0 ...MemberOfOtherUnion.invalid.ts.expected.md} | 0 ...ed => UnionWithDescription.ts.expected.md} | 0 ... DuplicateOneOfTag.invalid.ts.expected.md} | 0 ...GqlTagDoesNotExist.invalid.ts.expected.md} | 0 ...d => InvalidSyntax.invalid.ts.expected.md} | 0 ...xceptionOnNonField.invalid.ts.expected.md} | 0 ...peErrorWithTypeCheckingEnabled.ts.expected | 19 --------- ...rrorWithTypeCheckingEnabled.ts.expected.md | 0 ...=> WrongCaseGqlTag.invalid.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 ...index.ts.expected => index.ts.expected.md} | 0 481 files changed, 2 insertions(+), 98 deletions(-) rename src/tests/configParserFixtures/{empty.json.expected => empty.json.expected.md} (100%) rename src/tests/configParserFixtures/{experimentalField.json.expected => experimentalField.json.expected.md} (100%) rename src/tests/configParserFixtures/{invlaidKey.invalid.json.expected => invlaidKey.invalid.json.expected.md} (100%) rename src/tests/configParserFixtures/{multiLineHeader.json.expected => multiLineHeader.json.expected.md} (100%) rename src/tests/configParserFixtures/{multiLineNonHeader.invalid.json.expected => multiLineNonHeader.invalid.json.expected.md} (100%) rename src/tests/configParserFixtures/{nonNullableFieldIsNull.invalid.json.expected => nonNullableFieldIsNull.invalid.json.expected.md} (100%) rename src/tests/fixtures/arguments/{ArgReferencesNonGqlType.invalid.ts.expected => ArgReferencesNonGqlType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{ArgWithNoType.invalid.ts.expected => ArgWithNoType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{ArgumentWithDescription.ts.expected => ArgumentWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{AsyncIterableArgument.invalid.ts.expected => AsyncIterableArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{CustomScalarArgument.ts.expected => CustomScalarArgument.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{DeprecatedArgument.ts.expected => DeprecatedArgument.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{DeprecatedRequiredArgument.invalid.ts.expected => DeprecatedRequiredArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{GqlTypeUsedAsPositionalArg.ts.expected => GqlTypeUsedAsPositionalArg.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{MultipleParamsTypedAsTypeLiteral.invalid.ts.expected => MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{NoArgsWithNever.invalid.ts.expected => NoArgsWithNever.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{NoArgsWithUnknown.invalid.ts.expected => NoArgsWithUnknown.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{NoTypeAnnotation.invalid.ts.expected => NoTypeAnnotation.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{NullableArgumentErrors.invalid.ts.expected => NullableArgumentErrors.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{NullableArguments.ts.expected => NullableArguments.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{ObjectLiteralArgument.invalid.ts.expected => ObjectLiteralArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{OpaqueArgType.invalid.ts.expected => OpaqueArgType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{OptionalArgument.ts.expected => OptionalArgument.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{OptionalNonNullableArgument.invalid.ts.expected => OptionalNonNullableArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{OptionalNonNullableArgumentWithDefault.ts.expected => OptionalNonNullableArgumentWithDefault.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgAndArgs.invalid.ts.expected => PositionalArgAndArgs.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgDeprecatedOptional.ts.expected => PositionalArgDeprecatedOptional.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgDeprecatedWithDefault.ts.expected => PositionalArgDeprecatedWithDefault.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgOptional.ts.expected => PositionalArgOptional.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgOptionalNotNullable.invalid.ts.expected => PositionalArgOptionalNotNullable.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgWithDefault.ts.expected => PositionalArgWithDefault.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PositionalArgWithDescription.ts.expected => PositionalArgWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{PromiseArgument.invalid.ts.expected => PromiseArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{StringArgument.ts.expected => StringArgument.ts.expected.md} (100%) rename src/tests/fixtures/arguments/{TupleLiteralArgument.invalid.ts.expected => TupleLiteralArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/built_in_scalars/{FloatField.ts.expected => FloatField.ts.expected.md} (100%) rename src/tests/fixtures/built_in_scalars/{FloatFieldAliasedImport.ts.expected => FloatFieldAliasedImport.ts.expected.md} (100%) rename src/tests/fixtures/built_in_scalars/{IdField.ts.expected => IdField.ts.expected.md} (100%) rename src/tests/fixtures/built_in_scalars/{IntField.ts.expected => IntField.ts.expected.md} (100%) delete mode 100644 src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected create mode 100644 src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected.md rename src/tests/fixtures/comments/{commentFollowsDecorator.invalid.ts.expected => commentFollowsDecorator.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{detachedBlockComment.invalid.ts.expected => detachedBlockComment.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected => detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{detachedBlockCommentWithInvalidTagName.invalid.ts.expected => detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{detachedBlockCommentWithKillsParent.invalid.ts.expected => detachedBlockCommentWithKillsParent.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{detachedBlockCommentWithoutStar.invalid.ts.expected => detachedBlockCommentWithoutStar.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{invalidTagInLinecomment.invalid.ts.expected => invalidTagInLinecomment.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{lineComment.invalid.ts.expected => lineComment.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{lineCommentWrongCasing.invalid.ts.expected => lineCommentWrongCasing.invalid.ts.expected.md} (100%) rename src/tests/fixtures/comments/{nonJSDocBlockComment.invalid.ts.expected => nonJSDocBlockComment.invalid.ts.expected.md} (100%) rename src/tests/fixtures/configOptions/{headerIsArrayWithNumber.invalid.ts.expected => headerIsArrayWithNumber.invalid.ts.expected.md} (100%) rename src/tests/fixtures/configOptions/{importModuleSpecifierEnding.ts.expected => importModuleSpecifierEnding.ts.expected.md} (100%) rename src/tests/fixtures/configOptions/{invalidKey.invalid.ts.expected => invalidKey.invalid.ts.expected.md} (100%) rename src/tests/fixtures/configOptions/{multipleInvalidKeys.invalid.ts.expected => multipleInvalidKeys.invalid.ts.expected.md} (100%) rename src/tests/fixtures/configOptions/{nonNullableIsNull.invalid.ts.expected => nonNullableIsNull.invalid.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{DefineCustomScalar.ts.expected => DefineCustomScalar.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{DefineCustomScalarWithDescription.ts.expected => DefineCustomScalarWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{DefineRenamedCustomScalar.ts.expected => DefineRenamedCustomScalar.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{SpecifiedBy.ts.expected => SpecifiedBy.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{SpecifiedByMissingUrlinvalid.invalid.ts.expected => SpecifiedByMissingUrlinvalid.invalid.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{SpecifiedByOldSyntax.invalid.ts.expected => SpecifiedByOldSyntax.invalid.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{SpecifiedByOnEnum.invalid.ts.expected => SpecifiedByOnEnum.invalid.ts.expected.md} (100%) rename src/tests/fixtures/custom_scalars/{TagAttachedToWrongNode.invalid.ts.expected => TagAttachedToWrongNode.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentArray.ts.expected => DefaultArgumentArray.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentArrayValuesInvalid.invalid.ts.expected => DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentBooleanLiteral.ts.expected => DefaultArgumentBooleanLiteral.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentNullLiteral.ts.expected => DefaultArgumentNullLiteral.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentNumberLiteral.ts.expected => DefaultArgumentNumberLiteral.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentObjectLiteral.ts.expected => DefaultArgumentObjectLiteral.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected => DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected => DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected => DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentObjectLiteralSpread.invalid.ts.expected => DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentPropertyName.ts.expected => DefaultArgumentPropertyName.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentStringLiteral.ts.expected => DefaultArgumentStringLiteral.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentStringLiteralBackticks.ts.expected => DefaultArgumentStringLiteralBackticks.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected => DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md} (100%) rename src/tests/fixtures/default_values/{NonLiteralDefaultValue.invalid.ts.expected => NonLiteralDefaultValue.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{cyclicContextDependency.invalid.ts.expected => cyclicContextDependency.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{cyclicContextDependencyWithChain.invalid.ts.expected => cyclicContextDependencyWithChain.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{derivedContextChain.invalid.ts.expected => derivedContextChain.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{derivedContextNoReturnType.invalid.ts.expected => derivedContextNoReturnType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{derivedContextNonNamedReturnType.invalid.ts.expected => derivedContextNonNamedReturnType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{derivedContextUsedMultipleTimes.ts.expected => derivedContextUsedMultipleTimes.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{multipleDerivedContextsSameType.invalid.ts.expected => multipleDerivedContextsSameType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{simpleDerivedContext.ts.expected => simpleDerivedContext.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{simpleDerivedContextNoArgs.ts.expected => simpleDerivedContextNoArgs.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{simpleDerivedContextReadsRandomType.invalid.ts.expected => simpleDerivedContextReadsRandomType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/derived_context/{simpleDerivedContextUndefinedType.invalid.ts.expected => simpleDerivedContextUndefinedType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/descriptions/{BlankLinesAroundDescription.ts.expected => BlankLinesAroundDescription.ts.expected.md} (100%) rename src/tests/fixtures/descriptions/{BlankLinesFollowTypeTag.ts.expected => BlankLinesFollowTypeTag.ts.expected.md} (100%) rename src/tests/fixtures/descriptions/{DescriptionFollowsTypeTag.invalid.ts.expected => DescriptionFollowsTypeTag.invalid.ts.expected.md} (100%) rename src/tests/fixtures/descriptions/{DescriptionOnLineOfTypeTag.invalid.ts.expected => DescriptionOnLineOfTypeTag.invalid.ts.expected.md} (100%) delete mode 100644 src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected create mode 100644 src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected.md rename src/tests/fixtures/descriptions/{MultilineDescription.ts.expected => MultilineDescription.ts.expected.md} (100%) rename src/tests/fixtures/descriptions/{RenameFollowedByDescription.invalid.ts.expected => RenameFollowedByDescription.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirective.ts.expected => defineCustomDirective.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected => defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveArgsIsNever.ts.expected => defineCustomDirectiveArgsIsNever.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveCustomName.ts.expected => defineCustomDirectiveCustomName.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveLocationInvalid.invalid.ts.expected => defineCustomDirectiveLocationInvalid.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveMultipleLocations.ts.expected => defineCustomDirectiveMultipleLocations.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveNoLocation.invalid.ts.expected => defineCustomDirectiveNoLocation.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveOnIsNotString.invalid.ts.expected => defineCustomDirectiveOnIsNotString.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveReadsContext.invalid.ts.expected => defineCustomDirectiveReadsContext.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveRepeatable.ts.expected => defineCustomDirectiveRepeatable.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveWithArgs.ts.expected => defineCustomDirectiveWithArgs.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveWithArgsNonScalar.ts.expected => defineCustomDirectiveWithArgsNonScalar.ts.expected.md} (100%) rename src/tests/fixtures/directives/{defineCustomDirectiveWithArgsWithDefault.ts.expected => defineCustomDirectiveWithArgsWithDefault.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveArgFieldInvalid.invalid.ts.expected => directiveArgFieldInvalid.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveArgInvalidOneOf.invalid.ts.expected => directiveArgInvalidOneOf.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveArgumentNameIsStringLiteralWithDefault.ts.expected => directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveNotConst.invalid.ts.expected => directiveNotConst.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnArgumentDefinition.ts.expected => directiveOnArgumentDefinition.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnEnum.ts.expected => directiveOnEnum.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnEnumValue.ts.expected => directiveOnEnumValue.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnFieldDefinition.ts.expected => directiveOnFieldDefinition.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnInputFieldDefinition.ts.expected => directiveOnInputFieldDefinition.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnInputObjectType.ts.expected => directiveOnInputObjectType.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnInterface.ts.expected => directiveOnInterface.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnObjectType.ts.expected => directiveOnObjectType.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnScalar.ts.expected => directiveOnScalar.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveOnUnion.ts.expected => directiveOnUnion.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveUsedWithInvalidArgs.invalid.ts.expected => directiveUsedWithInvalidArgs.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{directiveWithSyntaxError.invalid.ts.expected => directiveWithSyntaxError.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{gqlAnnotateOnNonGqlDocblock.ts.expected => gqlAnnotateOnNonGqlDocblock.ts.expected.md} (100%) rename src/tests/fixtures/directives/{undefinedDirectiveWithArgs.invalid.ts.expected => undefinedDirectiveWithArgs.invalid.ts.expected.md} (100%) rename src/tests/fixtures/directives/{undefinedDirectiveWithoutArgs.ts.expected => undefinedDirectiveWithoutArgs.ts.expected.md} (100%) rename src/tests/fixtures/enums/{DeprecatedEnumVariant.ts.expected => DeprecatedEnumVariant.ts.expected.md} (100%) rename src/tests/fixtures/enums/{Enum.ts.expected => Enum.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumFromUnionType.ts.expected => EnumFromUnionType.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumFromUnionTypeNotLiteral.invalid.ts.expected => EnumFromUnionTypeNotLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumFromUnionTypeNotStringLiteral.invalid.ts.expected => EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumFromUnionTypeOfStringLiteral.ts.expected => EnumFromUnionTypeOfStringLiteral.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumFromUnionTypeWithDescription.ts.expected => EnumFromUnionTypeWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected => EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumNotValidIdentifier.invalid.ts.expected => EnumNotValidIdentifier.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumValuesDifferentThanNames.ts.expected => EnumValuesDifferentThanNames.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumWithDescription.ts.expected => EnumWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/enums/{EnumWithVariantWithDescription.ts.expected => EnumWithVariantWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/enums/{ExplicitlyNumericEnum.invalid.ts.expected => ExplicitlyNumericEnum.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected => ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{ImplicitlyNumericEnum.invalid.ts.expected => ImplicitlyNumericEnum.invalid.ts.expected.md} (100%) rename src/tests/fixtures/enums/{NonNullEnumDefault.ts.expected => NonNullEnumDefault.ts.expected.md} (100%) rename src/tests/fixtures/enums/{NonNullEnumDefaultInInputObject.ts.expected => NonNullEnumDefaultInInputObject.ts.expected.md} (100%) rename src/tests/fixtures/enums/{NonNullPluralEnumDefaults.ts.expected => NonNullPluralEnumDefaults.ts.expected.md} (100%) rename src/tests/fixtures/enums/{NonNullTsEnumDefault.ts.expected => NonNullTsEnumDefault.ts.expected.md} (100%) rename src/tests/fixtures/enums/{NonNullTsEnumDefaultStringLiteral.ts.expected => NonNullTsEnumDefaultStringLiteral.ts.expected.md} (100%) rename src/tests/fixtures/enums/{TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected => TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md} (100%) rename src/tests/fixtures/examples/{playground.ts.expected => playground.ts.expected.md} (100%) rename src/tests/fixtures/examples/{readme.ts.expected => readme.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{addStringFieldToEnum.invalid.ts.expected => addStringFieldToEnum.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{addStringFieldToInterface.ts.expected => addStringFieldToInterface.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{addStringFieldToInterfaceImplementedByInterface.ts.expected => addStringFieldToInterfaceImplementedByInterface.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{addStringFieldToInterfaceTwice.invalid.ts.expected => addStringFieldToInterfaceTwice.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{addStringFieldToNonGrats.invalid.ts.expected => addStringFieldToNonGrats.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{redefineFiledThatExistsOnConcreteType.invalid.ts.expected => redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_interface/{redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected => redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{addDeprecatedField.ts.expected => addDeprecatedField.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{addFieldWithArguments.ts.expected => addFieldWithArguments.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{addFieldWithDescription.ts.expected => addFieldWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{addRenamedFieldToSomeType.ts.expected => addRenamedFieldToSomeType.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{addStringFieldToSomeType.ts.expected => addStringFieldToSomeType.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{defaultExport.ts.expected => defaultExport.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsArrowFunctionLet.invalid.ts.expected => fieldAsArrowFunctionLet.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsArrowFunctionNotExported.invalid.ts.expected => fieldAsArrowFunctionNotExported.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsArrowFunctionVar.invalid.ts.expected => fieldAsArrowFunctionVar.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsExportedArrowFunction.ts.expected => fieldAsExportedArrowFunction.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsExportedArrowFunctionPositionalArgs.ts.expected => fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsExportedAsyncArrowFunction.ts.expected => fieldAsExportedAsyncArrowFunction.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsExportedMultipleVariables.invalid.ts.expected => fieldAsExportedMultipleVariables.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsExportedNothing.invalid.ts.expected => fieldAsExportedNothing.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{fieldAsExportedNumber.invalid.ts.expected => fieldAsExportedNumber.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{functionFieldOnTypeDefinedWithInterface.ts.expected => functionFieldOnTypeDefinedWithInterface.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{interfaceFirstArgumentType.ts.expected => interfaceFirstArgumentType.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{missingFirstArgument.invalid.ts.expected => missingFirstArgument.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{missingFirstArgumentType.invalid.ts.expected => missingFirstArgumentType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{nonAliasFirstArgumentType.invalid.ts.expected => nonAliasFirstArgumentType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{nonGQLFirstArgumentType.invalid.ts.expected => nonGQLFirstArgumentType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{notExported.invalid.ts.expected => notExported.invalid.ts.expected.md} (100%) rename src/tests/fixtures/extend_type/{optionalModelType.ts.expected => optionalModelType.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{DeprecatedMethodField.ts.expected => DeprecatedMethodField.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{DeprecatedPropertyField.ts.expected => DeprecatedPropertyField.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsSetter.invalid.ts.expected => FieldAsSetter.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethod.ts.expected => FieldAsStaticClassMethod.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethodInNestedScope.invalid.ts.expected => FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected => FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethodNotExported.invalid.ts.expected => FieldAsStaticClassMethodNotExported.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethodOnNonGqlClass.ts.expected => FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected => FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected => FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldDefinedOnNonGqlType.invalid.ts.expected => FieldDefinedOnNonGqlType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldOnArbitraryParam.invalid.ts.expected => FieldOnArbitraryParam.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FieldTagOnIncorrectNode.invalid.ts.expected => FieldTagOnIncorrectNode.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{FiledWithUnionOfMultipleTypes.invalid.ts.expected => FiledWithUnionOfMultipleTypes.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{GetAcessorField.ts.expected => GetAcessorField.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{MethodFieldMissingType.invalid.ts.expected => MethodFieldMissingType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{MethodSignatureOnInterface.ts.expected => MethodSignatureOnInterface.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{MultipleFieldsAsStaticClassMethods.ts.expected => MultipleFieldsAsStaticClassMethods.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyField.ts.expected => ParameterPropertyField.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldBindingPattern.invalid.ts.expected => ParameterPropertyFieldBindingPattern.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldDeprecated.ts.expected => ParameterPropertyFieldDeprecated.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldNoModifier.invalid.ts.expected => ParameterPropertyFieldNoModifier.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldNoType.invalid.ts.expected => ParameterPropertyFieldNoType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldReadOnly.ts.expected => ParameterPropertyFieldReadOnly.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected => ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldRenamed.ts.expected => ParameterPropertyFieldRenamed.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ParameterPropertyFieldWithDescription.ts.expected => ParameterPropertyFieldWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{PrivateAndProtectedFieldMethods.invalid.ts.expected => PrivateAndProtectedFieldMethods.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{PropertyFieldMissingType.invalid.ts.expected => PropertyFieldMissingType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{PublicFieldMethod.ts.expected => PublicFieldMethod.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ReferenceNonGraphQLType.invalid.ts.expected => ReferenceNonGraphQLType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{ReferenceUndefinedType.invalid.ts.expected => ReferenceUndefinedType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{RenamedField.ts.expected => RenamedField.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{RenamedFieldWithArgs.ts.expected => RenamedFieldWithArgs.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{RenamedFieldWithDescription.ts.expected => RenamedFieldWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{StringFieldWithDescription.ts.expected => StringFieldWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/field_definitions/{asyncFunctionFieldNotExported.invalid.ts.expected => asyncFunctionFieldNotExported.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{ArrayField.ts.expected => ArrayField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{ArrayOfPromises.ts.expected => ArrayOfPromises.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{ArrayShorthandField.ts.expected => ArrayShorthandField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{ArrayWithNullableItems.ts.expected => ArrayWithNullableItems.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{AsyncPromiseField.ts.expected => AsyncPromiseField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{BooleanField.ts.expected => BooleanField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{CustomScalar.ts.expected => CustomScalar.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{DuplicateFields.invalid.ts.expected => DuplicateFields.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected => KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{KitchenSink.ts.expected => KitchenSink.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{LinkedField.ts.expected => LinkedField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{LinkedFieldWithTypeArg.ts.expected => LinkedFieldWithTypeArg.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{MaybePromise.ts.expected => MaybePromise.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{OptionalFields.ts.expected => OptionalFields.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{OptionalProperty.ts.expected => OptionalProperty.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{OptionalStringFieldKillsParentOnException.invalid.ts.expected => OptionalStringFieldKillsParentOnException.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{ParenthesizedType.ts.expected => ParenthesizedType.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{PromiseOfPromise.ts.expected => PromiseOfPromise.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{ReadonlyArrayField.ts.expected => ReadonlyArrayField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{RenamedType.ts.expected => RenamedType.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{RenamedTypeOutOfOrder.ts.expected => RenamedTypeOutOfOrder.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{StringField.ts.expected => StringField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{StringFieldKillsParentOnException.ts.expected => StringFieldKillsParentOnException.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected => StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md} (100%) rename src/tests/fixtures/field_values/{UnionField.ts.expected => UnionField.ts.expected.md} (100%) rename src/tests/fixtures/field_values/non_default_nullable/{NonNullablePromise.ts.expected => NonNullablePromise.ts.expected.md} (100%) rename src/tests/fixtures/field_values/non_default_nullable/{NullablePromise.ts.expected => NullablePromise.ts.expected.md} (100%) rename src/tests/fixtures/generics/{arrayPassedToGeneric.invalid.ts.expected => arrayPassedToGeneric.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{complexMutualReferences.ts.expected => complexMutualReferences.ts.expected.md} (100%) rename src/tests/fixtures/generics/{connection.ts.expected => connection.ts.expected.md} (100%) rename src/tests/fixtures/generics/{connectionEdgeAsGeneric.ts.expected => connectionEdgeAsGeneric.ts.expected.md} (100%) rename src/tests/fixtures/generics/{defineFieldOnGeneric.ts.expected => defineFieldOnGeneric.ts.expected.md} (100%) rename src/tests/fixtures/generics/{edge.ts.expected => edge.ts.expected.md} (100%) rename src/tests/fixtures/generics/{enumWithGeneric.invalid.ts.expected => enumWithGeneric.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericInputType.ts.expected => genericInputType.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericInterface.ts.expected => genericInterface.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericOverArg.ts.expected => genericOverArg.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericReferencedMoreThanOnce.ts.expected => genericReferencedMoreThanOnce.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericTypeUsedAsUnionMember.invalid.ts.expected => genericTypeUsedAsUnionMember.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected => genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericTypeUsingClass.ts.expected => genericTypeUsingClass.ts.expected.md} (100%) rename src/tests/fixtures/generics/{genericTypeUsingInterface.ts.expected => genericTypeUsingInterface.ts.expected.md} (100%) rename src/tests/fixtures/generics/{missingGqlGenericTypeArg.invalid.ts.expected => missingGqlGenericTypeArg.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{multiparamGeneric.ts.expected => multiparamGeneric.ts.expected.md} (100%) rename src/tests/fixtures/generics/names/{skippedTypeParam.ts.expected => skippedTypeParam.ts.expected.md} (100%) rename src/tests/fixtures/generics/names/{skippedTypeParamPassesLiteral.ts.expected => skippedTypeParamPassesLiteral.ts.expected.md} (100%) rename src/tests/fixtures/generics/{passOuptutTypeToInputType.input.invalid.ts.expected => passOuptutTypeToInputType.input.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{referencingMethodGeneric.invalid.ts.expected => referencingMethodGeneric.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{result.ts.expected => result.ts.expected.md} (100%) rename src/tests/fixtures/generics/{scalarPassedAsGenericArg.invalid.ts.expected => scalarPassedAsGenericArg.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/{scalarPassedAsNonGqlGenericArg.ts.expected => scalarPassedAsNonGqlGenericArg.ts.expected.md} (100%) rename src/tests/fixtures/generics/{scalarWithGeneric.ts.expected => scalarWithGeneric.ts.expected.md} (100%) rename src/tests/fixtures/generics/todo/{genericInterfaceFromTypeParam.invalid.ts.expected => genericInterfaceFromTypeParam.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/todo/{genericTypeImplementsInterface.invalid.ts.expected => genericTypeImplementsInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/generics/todo/{genericTypeMemberOfUnion.ts.expected => genericTypeMemberOfUnion.ts.expected.md} (100%) rename src/tests/fixtures/generics/{undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected => undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md} (100%) rename src/tests/fixtures/headers/{customHeaders.ts.expected => customHeaders.ts.expected.md} (100%) rename src/tests/fixtures/headers/{multilineHeader.ts.expected => multilineHeader.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfDeprecated.invalid.ts.expected => oneOfDeprecated.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfFieldIsNullable.ts.expected => oneOfFieldIsNullable.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfFieldIsOptional.ts.expected => oneOfFieldIsOptional.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfFieldMissingTypeAnnotation.invalid.ts.expected => oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfFieldTypeList.ts.expected => oneOfFieldTypeList.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfFieldTypeListOfNullable.ts.expected => oneOfFieldTypeListOfNullable.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfFieldTypeNotGraphQL.invalid.ts.expected => oneOfFieldTypeNotGraphQL.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfMemberHasMultipleFields.invalid.ts.expected => oneOfMemberHasMultipleFields.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfMemberHasNoField.invalid.ts.expected => oneOfMemberHasNoField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfUnionMemberNotLiteral.invalid.ts.expected => oneOfUnionMemberNotLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfWithFieldDescription.ts.expected => oneOfWithFieldDescription.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfWithFieldDescriptionInsideObj.ts.expected => oneOfWithFieldDescriptionInsideObj.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{oneOfWithTypeDescription.ts.expected => oneOfWithTypeDescription.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{simpleOneOf.ts.expected => simpleOneOf.ts.expected.md} (100%) rename src/tests/fixtures/input_type_one_of/{simpleOneOfDeprecatedTag.invalid.ts.expected => simpleOneOfDeprecatedTag.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{ContextReferencedInInputType.invalid.ts.expected => ContextReferencedInInputType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{DeprecatedInputType.invalid.ts.expected => DeprecatedInputType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputType.ts.expected => InputType.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeInterface.ts.expected => InputTypeInterface.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeInterfaceFunction.invalid.ts.expected => InputTypeInterfaceFunction.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeInterfaceMethod.invalid.ts.expected => InputTypeInterfaceMethod.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeInterfaceOptionalField.ts.expected => InputTypeInterfaceOptionalField.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeInterfacePromiseField.invalid.ts.expected => InputTypeInterfacePromiseField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeMergedInterface.invalid.ts.expected => InputTypeMergedInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeOptionalField.ts.expected => InputTypeOptionalField.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeReferencingOutputType.invalid.ts.expected => InputTypeReferencingOutputType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeReturnedFromField.invalid.ts.expected => InputTypeReturnedFromField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeWithDeprecatedField.ts.expected => InputTypeWithDeprecatedField.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeWithDeprecatedRequiredField.invalid.ts.expected => InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeWithDescription.ts.expected => InputTypeWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{InputTypeWithFieldDescription.ts.expected => InputTypeWithFieldDescription.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{RenamedInputType.ts.expected => RenamedInputType.ts.expected.md} (100%) rename src/tests/fixtures/input_types/{inputFieldWithGqlField.invalid.ts.expected => inputFieldWithGqlField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{FieldReturnsInterface.ts.expected => FieldReturnsInterface.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{IgnoresExtendsClause.ts.expected => IgnoresExtendsClause.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{ImplementsInterface.ts.expected => ImplementsInterface.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{ImplementsInterfaceWithTypeParam.ts.expected => ImplementsInterfaceWithTypeParam.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{ImplementsMultipleInterfaces.ts.expected => ImplementsMultipleInterfaces.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{ImplementsRenamedInterface.ts.expected => ImplementsRenamedInterface.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceDefinitionExtendsGqlInterface.ts.expected => InterfaceDefinitionExtendsGqlInterface.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceExtendsInterface.ts.expected => InterfaceExtendsInterface.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceFieldWithDescription.ts.expected => InterfaceFieldWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected => InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceImplementsInterface.ts.expected => InterfaceImplementsInterface.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceMergedIntoClass.invalid.ts.expected => InterfaceMergedIntoClass.invalid.ts.expected.md} (100%) delete mode 100644 src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected create mode 100644 src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected.md rename src/tests/fixtures/interfaces/{InterfaceMergedIntoObject.ts.expected => InterfaceMergedIntoObject.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceMissingFields.invalid.ts.expected => InterfaceMissingFields.invalid.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceWithCustomName.ts.expected => InterfaceWithCustomName.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceWithDeprecatedField.ts.expected => InterfaceWithDeprecatedField.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{InterfaceWithDescription.ts.expected => InterfaceWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{MergedInterfaces.invalid.ts.expected => MergedInterfaces.invalid.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{TagAttachedToWrongNode.invalid.ts.expected => TagAttachedToWrongNode.invalid.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/{extendInterfaceWithNonGqlType.ts.expected => extendInterfaceWithNonGqlType.ts.expected.md} (100%) rename src/tests/fixtures/interfaces/tag/{ImplementsTagWithoutTypeOrInterface.invalid.ts.expected => ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{fieldOnScalar.invalid.ts.expected => fieldOnScalar.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{genericType.invalid.ts.expected => genericType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{genericTypeField.invalid.ts.expected => genericTypeField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{inputType.invalid.ts.expected => inputType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{inputTypeField.invalid.ts.expected => inputTypeField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{interface.invalid.ts.expected => interface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{malformedEntitySyntax.invalid.ts.expected => malformedEntitySyntax.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{notFoundField.invalid.ts.expected => notFoundField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{notFoundType.invalid.ts.expected => notFoundType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{type.invalid.ts.expected => type.invalid.ts.expected.md} (100%) rename src/tests/fixtures/locate/{typeField.invalid.ts.expected => typeField.invalid.ts.expected.md} (100%) rename src/tests/fixtures/regression/{fieldFollowedByDeprecated.ts.expected => fieldFollowedByDeprecated.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ClassMethodWithContextValue.ts.expected => ClassMethodWithContextValue.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ClassMethodWithContextValueExported.ts.expected => ClassMethodWithContextValueExported.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ClassMethodWithContextValueInArgsPos.invalid.ts.expected => ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueBeforeArgs.ts.expected => ContextValueBeforeArgs.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueMissingTypeAnnotation.invalid.ts.expected => ContextValueMissingTypeAnnotation.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueOptional.ts.expected => ContextValueOptional.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueReadTwice.ts.expected => ContextValueReadTwice.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueSpread.invalid.ts.expected => ContextValueSpread.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueTypeNotDefined.invalid.ts.expected => ContextValueTypeNotDefined.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueTypedAsAny.invalid.ts.expected => ContextValueTypedAsAny.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueTypedAsNever.invalid.ts.expected => ContextValueTypedAsNever.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{ContextValueTypedAsUnknown.invalid.ts.expected => ContextValueTypedAsUnknown.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{FunctionWithContextValue.ts.expected => FunctionWithContextValue.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{MultipleClassMethodsReferencingContextValue.ts.expected => MultipleClassMethodsReferencingContextValue.ts.expected.md} (100%) rename src/tests/fixtures/resolver_context/{MultipleContextValuesUsed.invalid.ts.expected => MultipleContextValuesUsed.invalid.ts.expected.md} (100%) rename src/tests/fixtures/resolver_info/{ClassMethodWithInfoValue.ts.expected => ClassMethodWithInfoValue.ts.expected.md} (100%) rename src/tests/fixtures/resolver_info/{FunctionWithInfoValue.ts.expected => FunctionWithInfoValue.ts.expected.md} (100%) rename src/tests/fixtures/resolver_info/{StaticMethodWithInfoValue.ts.expected => StaticMethodWithInfoValue.ts.expected.md} (100%) rename src/tests/fixtures/semantic_nullability/{nonNullDoesNotMatchInterface.invalid.ts.expected => nonNullDoesNotMatchInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/semantic_nullability/{semanticNonNull.ts.expected => semanticNonNull.ts.expected.md} (100%) rename src/tests/fixtures/semantic_nullability/{semanticNonNullDoesNotMatchInterface.invalid.ts.expected => semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/semantic_nullability/{semanticNonNullMatchesInterface.ts.expected => semanticNonNullMatchesInterface.ts.expected.md} (100%) rename src/tests/fixtures/semantic_nullability/{semanticNull.ts.expected => semanticNull.ts.expected.md} (100%) rename src/tests/fixtures/subscriptions/{InputTypeWithAsyncIterable.invalid.ts.expected => InputTypeWithAsyncIterable.invalid.ts.expected.md} (100%) rename src/tests/fixtures/subscriptions/{InterfaceWithAsyncIterable.ts.expected => InterfaceWithAsyncIterable.ts.expected.md} (100%) rename src/tests/fixtures/subscriptions/{NonSubscriptionClassWithAsyncIterable.ts.expected => NonSubscriptionClassWithAsyncIterable.ts.expected.md} (100%) rename src/tests/fixtures/subscriptions/{SubscriptionClassWithAsyncIterable.invalid.ts.expected => SubscriptionClassWithAsyncIterable.invalid.ts.expected.md} (100%) rename src/tests/fixtures/subscriptions/{SubscriptionFunctionFieldWithAsyncIterable.ts.expected => SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md} (100%) rename src/tests/fixtures/todo/{EnumFromUnionTypeWithVariantWithDescription.ts.expected => EnumFromUnionTypeWithVariantWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/todo/{RedefineBuiltinScalar.ts.expected => RedefineBuiltinScalar.ts.expected.md} (100%) rename src/tests/fixtures/todo/{userExample.ts.expected => userExample.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{queryField.ts.expected => queryField.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{queryFieldOnMethod.invalid.ts.expected => queryFieldOnMethod.invalid.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{queryFieldOnStaticMethod.ts.expected => queryFieldOnStaticMethod.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{queryFieldRenamed.ts.expected => queryFieldRenamed.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{queryFieldWithExplicitlyDefinedQuery.ts.expected => queryFieldWithExplicitlyDefinedQuery.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{queryFieldWithFirstArgParentType.invalid.ts.expected => queryFieldWithFirstArgParentType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{rootFields.ts.expected => rootFields.ts.expected.md} (100%) rename src/tests/fixtures/top_level_fields/{rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected => rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{ClassImplementsNonGqlInterface.ts.expected => ClassImplementsNonGqlInterface.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{ClassMissingFields.invalid.ts.expected => ClassMissingFields.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{ClassWithDescription.ts.expected => ClassWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{ClassWithDescriptionAndCustomName.ts.expected => ClassWithDescriptionAndCustomName.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{ClassWithoutAName.invalid.ts.expected => ClassWithoutAName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{QueryAsClass.invalid.ts.expected => QueryAsClass.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{RenamedType.ts.expected => RenamedType.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{RenamedTypeHasDash.invalid.ts.expected => RenamedTypeHasDash.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{RenamedTypeNewLine.invalid.ts.expected => RenamedTypeNewLine.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{RenamedTypeStartsWithNumber.invalid.ts.expected => RenamedTypeStartsWithNumber.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{RenamedTypeWithoutClassName.invalid.ts.expected => RenamedTypeWithoutClassName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{TagAttachedToWrongNode.invalid.ts.expected => TagAttachedToWrongNode.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{TypeFromClassDefinitionImplementsInterface.ts.expected => TypeFromClassDefinitionImplementsInterface.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected => TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions/{TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected => TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasIsArrayNotLiteral.invalid.ts.expected => AliasIsArrayNotLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasIsNumberNotLiteral.invalid.ts.expected => AliasIsNumberNotLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasOfUnknownDefinesType.ts.expected => AliasOfUnknownDefinesType.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasType.ts.expected => AliasType.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasTypeImplementsInterface.invalid.ts.expected => AliasTypeImplementsInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasWithDescription.ts.expected => AliasWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{AliasWithDescriptionAndCustomName.ts.expected => AliasWithDescriptionAndCustomName.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{QueryAsAliasOfObject.invalid.ts.expected => QueryAsAliasOfObject.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{QueryAsAliasOfUndefined.invalid.ts.expected => QueryAsAliasOfUndefined.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{QueryAsAliasOfUnknown.ts.expected => QueryAsAliasOfUnknown.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_alias/{RenamedType.ts.expected => RenamedType.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{InterfaceType.ts.expected => InterfaceType.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{InterfaceTypeExtendsGqlInterface.ts.expected => InterfaceTypeExtendsGqlInterface.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected => InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{InterfaceTypeImplementsInterface.ts.expected => InterfaceTypeImplementsInterface.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{InterfaceWithDescription.ts.expected => InterfaceWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{InterfaceWithDescriptionAndCustomName.ts.expected => InterfaceWithDescriptionAndCustomName.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{QueryFromInterface.invalid.ts.expected => QueryFromInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{RenamedType.ts.expected => RenamedType.ts.expected.md} (100%) rename src/tests/fixtures/type_definitions_from_interface/{TagAttachedToWrongNode.invalid.ts.expected => TagAttachedToWrongNode.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{ImplementorMissingTypename.invalid.ts.expected => ImplementorMissingTypename.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{MethodTypename.invalid.ts.expected => MethodTypename.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertySignatureTypename.ts.expected => PropertySignatureTypename.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertySignatureTypenameIncorrectName.invalid.ts.expected => PropertySignatureTypenameIncorrectName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertySignatureTypenameMissingType.invalid.ts.expected => PropertySignatureTypenameMissingType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertySignatureTypenameNonLiteralType.invalid.ts.expected => PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypename.ts.expected => PropertyTypename.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypenameDoesNotMatchClassName.invalid.ts.expected => PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected => PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected => PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected => PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypenameNoInitializer.invalid.ts.expected => PropertyTypenameNoInitializer.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{PropertyTypenameNonStringInitializer.invalid.ts.expected => PropertyTypenameNonStringInitializer.invalid.ts.expected.md} (100%) rename src/tests/fixtures/typename/{UnionMemberMissingTypename.invalid.ts.expected => UnionMemberMissingTypename.invalid.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionOfOneType.ts.expected => DefineUnionOfOneType.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionType.ts.expected => DefineUnionType.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionTypeContainingInterface.invalid.ts.expected => DefineUnionTypeContainingInterface.invalid.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionTypeReferencingInputType.invalid.ts.expected => DefineUnionTypeReferencingInputType.invalid.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionTypeReferencingLiteral.invalid.ts.expected => DefineUnionTypeReferencingLiteral.invalid.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionTypeWithInterfaces.ts.expected => DefineUnionTypeWithInterfaces.ts.expected.md} (100%) rename src/tests/fixtures/unions/{DefineUnionTypeWithTypeLiterals.ts.expected => DefineUnionTypeWithTypeLiterals.ts.expected.md} (100%) rename src/tests/fixtures/unions/{UnionAsMemberOfItself.invalid.ts.expected => UnionAsMemberOfItself.invalid.ts.expected.md} (100%) rename src/tests/fixtures/unions/{UnionAsMemberOfOtherUnion.invalid.ts.expected => UnionAsMemberOfOtherUnion.invalid.ts.expected.md} (100%) rename src/tests/fixtures/unions/{UnionWithDescription.ts.expected => UnionWithDescription.ts.expected.md} (100%) rename src/tests/fixtures/user_error/{DuplicateOneOfTag.invalid.ts.expected => DuplicateOneOfTag.invalid.ts.expected.md} (100%) rename src/tests/fixtures/user_error/{GqlTagDoesNotExist.invalid.ts.expected => GqlTagDoesNotExist.invalid.ts.expected.md} (100%) rename src/tests/fixtures/user_error/{InvalidSyntax.invalid.ts.expected => InvalidSyntax.invalid.ts.expected.md} (100%) rename src/tests/fixtures/user_error/{KillsParentOnExceptionOnNonField.invalid.ts.expected => KillsParentOnExceptionOnNonField.invalid.ts.expected.md} (100%) delete mode 100644 src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected create mode 100644 src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected.md rename src/tests/fixtures/user_error/{WrongCaseGqlTag.invalid.ts.expected => WrongCaseGqlTag.invalid.ts.expected.md} (100%) rename src/tests/integrationFixtures/aliasedMethod/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/complexDefaultInput/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/complexPlurals/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/connectionExample/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/customScalarSerialization/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/deprecated/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/derivedContext/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/enumDefault/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/enumExport/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/functionField/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/functionFieldRenamed/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/getAcessor/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/inputTypeOneOf/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/killsParentOnException/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/killsParentOnExceptionOnQuery/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/nonNullArgWithDefault/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/nonNullEnumDefault/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/nonNullableListIncludesNull/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/numericID/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/parameterPropertyRenamed/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/positionalNonNullArgWithDefault/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/promiseOfPromise/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/resolveTypeViaClass/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/resolverErrorElidedToNull/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/skipInclude/{index.ts.expected => index.ts.expected.md} (100%) rename src/tests/integrationFixtures/strictSemanticNullability/{index.ts.expected => index.ts.expected.md} (100%) diff --git a/.prettierignore b/.prettierignore index c3c435b3..781ba65d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -16,3 +16,4 @@ examples/incremental-migration/schemas/gratsGeneratedSchema.ts # Local Netlify folder .netlify website/src/workers/ts.worker.mjs +*.expected.md diff --git a/src/tests/TestRunner.ts b/src/tests/TestRunner.ts index f3cc890f..6d87bc27 100644 --- a/src/tests/TestRunner.ts +++ b/src/tests/TestRunner.ts @@ -86,7 +86,7 @@ export default class TestRunner { fixture: string, { interactive }: { interactive: boolean }, ) { - const expectedFileName = fixture + ".expected"; + const expectedFileName = fixture + ".expected.md"; const expectedFilePath = path.join(this._fixturesDir, expectedFileName); if (this._otherFiles.has(expectedFileName)) { this._otherFiles.delete(expectedFileName); diff --git a/src/tests/configParserFixtures/empty.json.expected b/src/tests/configParserFixtures/empty.json.expected.md similarity index 100% rename from src/tests/configParserFixtures/empty.json.expected rename to src/tests/configParserFixtures/empty.json.expected.md diff --git a/src/tests/configParserFixtures/experimentalField.json.expected b/src/tests/configParserFixtures/experimentalField.json.expected.md similarity index 100% rename from src/tests/configParserFixtures/experimentalField.json.expected rename to src/tests/configParserFixtures/experimentalField.json.expected.md diff --git a/src/tests/configParserFixtures/invlaidKey.invalid.json.expected b/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md similarity index 100% rename from src/tests/configParserFixtures/invlaidKey.invalid.json.expected rename to src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md diff --git a/src/tests/configParserFixtures/multiLineHeader.json.expected b/src/tests/configParserFixtures/multiLineHeader.json.expected.md similarity index 100% rename from src/tests/configParserFixtures/multiLineHeader.json.expected rename to src/tests/configParserFixtures/multiLineHeader.json.expected.md diff --git a/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected b/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md similarity index 100% rename from src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected rename to src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md diff --git a/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected b/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md similarity index 100% rename from src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected rename to src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md diff --git a/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected b/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected rename to src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected b/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected rename to src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected b/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected rename to src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md diff --git a/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected b/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected rename to src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected b/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/CustomScalarArgument.ts.expected rename to src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md diff --git a/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected b/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/DeprecatedArgument.ts.expected rename to src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md diff --git a/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected b/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected rename to src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected b/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected rename to src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md diff --git a/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected b/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected rename to src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected b/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected rename to src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected b/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected rename to src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected b/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected rename to src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected rename to src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/NullableArguments.ts.expected b/src/tests/fixtures/arguments/NullableArguments.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/NullableArguments.ts.expected rename to src/tests/fixtures/arguments/NullableArguments.ts.expected.md diff --git a/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected b/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected rename to src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected b/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected rename to src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/OptionalArgument.ts.expected b/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/OptionalArgument.ts.expected rename to src/tests/fixtures/arguments/OptionalArgument.ts.expected.md diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected rename to src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected b/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected rename to src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected b/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected rename to src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected b/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected rename to src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected b/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected rename to src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected b/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgOptional.ts.expected rename to src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected rename to src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected b/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected rename to src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md diff --git a/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected b/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected rename to src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md diff --git a/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected b/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected rename to src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/arguments/StringArgument.ts.expected b/src/tests/fixtures/arguments/StringArgument.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/StringArgument.ts.expected rename to src/tests/fixtures/arguments/StringArgument.ts.expected.md diff --git a/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected b/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected rename to src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/built_in_scalars/FloatField.ts.expected b/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md similarity index 100% rename from src/tests/fixtures/built_in_scalars/FloatField.ts.expected rename to src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md diff --git a/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected b/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md similarity index 100% rename from src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected rename to src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md diff --git a/src/tests/fixtures/built_in_scalars/IdField.ts.expected b/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md similarity index 100% rename from src/tests/fixtures/built_in_scalars/IdField.ts.expected rename to src/tests/fixtures/built_in_scalars/IdField.ts.expected.md diff --git a/src/tests/fixtures/built_in_scalars/IntField.ts.expected b/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md similarity index 100% rename from src/tests/fixtures/built_in_scalars/IntField.ts.expected rename to src/tests/fixtures/built_in_scalars/IntField.ts.expected.md diff --git a/src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected b/src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected deleted file mode 100644 index 8e8ecb11..00000000 --- a/src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected +++ /dev/null @@ -1,13 +0,0 @@ ------------------ -INPUT ------------------ -/*** @gqlType */ -class User {} - ------------------ -OUTPUT ------------------ -src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts:1:6 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position with is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax - -1 /*** @gqlType */ - ~~~~~~~~ diff --git a/src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected.md b/src/tests/fixtures/comments/blockCommentThreeStars.invalid.ts.expected.md new file mode 100644 index 00000000..e69de29b diff --git a/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected b/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected rename to src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected b/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected rename to src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected rename to src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected b/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected rename to src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected b/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected rename to src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected b/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected rename to src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected rename to src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/lineComment.invalid.ts.expected b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/lineComment.invalid.ts.expected rename to src/tests/fixtures/comments/lineComment.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected rename to src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md diff --git a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected rename to src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md diff --git a/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected b/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected rename to src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md diff --git a/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected b/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md similarity index 100% rename from src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected rename to src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md diff --git a/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected b/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected rename to src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md diff --git a/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected b/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected rename to src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md diff --git a/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected b/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected rename to src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected b/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected rename to src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected b/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected rename to src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected b/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected rename to src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected b/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected rename to src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected b/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected rename to src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected rename to src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected b/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected rename to src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md diff --git a/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected b/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected rename to src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected rename to src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md diff --git a/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected b/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected rename to src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected b/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected rename to src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected b/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected rename to src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected b/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected rename to src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected b/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected rename to src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected b/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected rename to src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected b/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected rename to src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md diff --git a/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected b/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected rename to src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected b/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected rename to src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected b/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected rename to src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected b/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected rename to src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected b/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected rename to src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md diff --git a/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected b/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected rename to src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md diff --git a/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected b/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md similarity index 100% rename from src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected rename to src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md diff --git a/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected b/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected rename to src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md diff --git a/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected b/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected rename to src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md diff --git a/src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected b/src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected deleted file mode 100644 index 273f50ef..00000000 --- a/src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected +++ /dev/null @@ -1,40 +0,0 @@ ------------------ -INPUT ------------------ -// { "tsVersion": "5.0.2" } -/** - * This type was added by @captbaritone! - * @gqlType - */ -class SomeType { - /** @gqlField */ - name: string; -} - ------------------ -OUTPUT ------------------ --- SDL -- -"""This type was added by @captbaritone!""" -type SomeType { - name: String @metadata -} --- TypeScript -- -import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; -export function getSchema(): GraphQLSchema { - const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ - name: "SomeType", - description: "This type was added by @captbaritone!", - fields() { - return { - name: { - name: "name", - type: GraphQLString - } - }; - } - }); - return new GraphQLSchema({ - types: [SomeTypeType] - }); -} diff --git a/src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected.md b/src/tests/fixtures/descriptions/DescriptionWithGitHubHandle.ts.expected.md new file mode 100644 index 00000000..e69de29b diff --git a/src/tests/fixtures/descriptions/MultilineDescription.ts.expected b/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/descriptions/MultilineDescription.ts.expected rename to src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md diff --git a/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected b/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected rename to src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirective.ts.expected b/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirective.ts.expected rename to src/tests/fixtures/directives/defineCustomDirective.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected rename to src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected b/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected rename to src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected b/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected rename to src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected b/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected rename to src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected b/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected rename to src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected b/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected rename to src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnEnum.ts.expected b/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnEnum.ts.expected rename to src/tests/fixtures/directives/directiveOnEnum.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected b/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnEnumValue.ts.expected rename to src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected b/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected rename to src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected b/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected rename to src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected b/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected rename to src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnInterface.ts.expected b/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnInterface.ts.expected rename to src/tests/fixtures/directives/directiveOnInterface.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnObjectType.ts.expected b/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnObjectType.ts.expected rename to src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnScalar.ts.expected b/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnScalar.ts.expected rename to src/tests/fixtures/directives/directiveOnScalar.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveOnUnion.ts.expected b/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveOnUnion.ts.expected rename to src/tests/fixtures/directives/directiveOnUnion.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected b/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected rename to src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected b/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected rename to src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected b/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected rename to src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md diff --git a/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected b/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected rename to src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md diff --git a/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected b/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md similarity index 100% rename from src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected rename to src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md diff --git a/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected b/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected rename to src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md diff --git a/src/tests/fixtures/enums/Enum.ts.expected b/src/tests/fixtures/enums/Enum.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/Enum.ts.expected rename to src/tests/fixtures/enums/Enum.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumFromUnionType.ts.expected b/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumFromUnionType.ts.expected rename to src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected b/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected rename to src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected b/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected rename to src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected b/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected rename to src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected b/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected rename to src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected rename to src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected b/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected rename to src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected b/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected rename to src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumWithDescription.ts.expected b/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumWithDescription.ts.expected rename to src/tests/fixtures/enums/EnumWithDescription.ts.expected.md diff --git a/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected b/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected rename to src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md diff --git a/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected b/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected rename to src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected b/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected rename to src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected b/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected rename to src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md diff --git a/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected b/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/NonNullEnumDefault.ts.expected rename to src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md diff --git a/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected b/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected rename to src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md diff --git a/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected b/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected rename to src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md diff --git a/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected b/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected rename to src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md diff --git a/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected b/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected rename to src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md diff --git a/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected b/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected rename to src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md diff --git a/src/tests/fixtures/examples/playground.ts.expected b/src/tests/fixtures/examples/playground.ts.expected.md similarity index 100% rename from src/tests/fixtures/examples/playground.ts.expected rename to src/tests/fixtures/examples/playground.ts.expected.md diff --git a/src/tests/fixtures/examples/readme.ts.expected b/src/tests/fixtures/examples/readme.ts.expected.md similarity index 100% rename from src/tests/fixtures/examples/readme.ts.expected rename to src/tests/fixtures/examples/readme.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected b/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected rename to src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected b/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected rename to src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected rename to src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected rename to src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected b/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected rename to src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected rename to src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected rename to src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected b/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/addDeprecatedField.ts.expected rename to src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md diff --git a/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected b/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected rename to src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md diff --git a/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected b/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected rename to src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md diff --git a/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected b/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected rename to src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md diff --git a/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected b/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected rename to src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md diff --git a/src/tests/fixtures/extend_type/defaultExport.ts.expected b/src/tests/fixtures/extend_type/defaultExport.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/defaultExport.ts.expected rename to src/tests/fixtures/extend_type/defaultExport.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected b/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected rename to src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected rename to src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected b/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected rename to src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected rename to src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected rename to src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected b/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected rename to src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected b/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected rename to src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected b/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected rename to src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected b/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected rename to src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected b/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected rename to src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md diff --git a/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected b/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected rename to src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md diff --git a/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected b/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected rename to src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected b/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected rename to src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected b/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected rename to src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected b/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected rename to src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/notExported.invalid.ts.expected rename to src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md diff --git a/src/tests/fixtures/extend_type/optionalModelType.ts.expected b/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md similarity index 100% rename from src/tests/fixtures/extend_type/optionalModelType.ts.expected rename to src/tests/fixtures/extend_type/optionalModelType.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected b/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected rename to src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected b/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected rename to src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected rename to src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected b/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected b/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected rename to src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected b/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/GetAcessorField.ts.expected rename to src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected b/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected rename to src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected b/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected rename to src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected b/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected rename to src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected b/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected rename to src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected b/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected rename to src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected b/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected rename to src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected b/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected rename to src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected b/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected rename to src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected b/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected rename to src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/RenamedField.ts.expected b/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/RenamedField.ts.expected rename to src/tests/fixtures/field_definitions/RenamedField.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected b/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected rename to src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected b/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected rename to src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected b/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected rename to src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md diff --git a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected rename to src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_values/ArrayField.ts.expected b/src/tests/fixtures/field_values/ArrayField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/ArrayField.ts.expected rename to src/tests/fixtures/field_values/ArrayField.ts.expected.md diff --git a/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected b/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/ArrayOfPromises.ts.expected rename to src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md diff --git a/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected b/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/ArrayShorthandField.ts.expected rename to src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md diff --git a/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected b/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected rename to src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md diff --git a/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected b/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/AsyncPromiseField.ts.expected rename to src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md diff --git a/src/tests/fixtures/field_values/BooleanField.ts.expected b/src/tests/fixtures/field_values/BooleanField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/BooleanField.ts.expected rename to src/tests/fixtures/field_values/BooleanField.ts.expected.md diff --git a/src/tests/fixtures/field_values/CustomScalar.ts.expected b/src/tests/fixtures/field_values/CustomScalar.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/CustomScalar.ts.expected rename to src/tests/fixtures/field_values/CustomScalar.ts.expected.md diff --git a/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected b/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected rename to src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected b/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected rename to src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_values/KitchenSink.ts.expected b/src/tests/fixtures/field_values/KitchenSink.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/KitchenSink.ts.expected rename to src/tests/fixtures/field_values/KitchenSink.ts.expected.md diff --git a/src/tests/fixtures/field_values/LinkedField.ts.expected b/src/tests/fixtures/field_values/LinkedField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/LinkedField.ts.expected rename to src/tests/fixtures/field_values/LinkedField.ts.expected.md diff --git a/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected b/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected rename to src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md diff --git a/src/tests/fixtures/field_values/MaybePromise.ts.expected b/src/tests/fixtures/field_values/MaybePromise.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/MaybePromise.ts.expected rename to src/tests/fixtures/field_values/MaybePromise.ts.expected.md diff --git a/src/tests/fixtures/field_values/OptionalFields.ts.expected b/src/tests/fixtures/field_values/OptionalFields.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/OptionalFields.ts.expected rename to src/tests/fixtures/field_values/OptionalFields.ts.expected.md diff --git a/src/tests/fixtures/field_values/OptionalProperty.ts.expected b/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/OptionalProperty.ts.expected rename to src/tests/fixtures/field_values/OptionalProperty.ts.expected.md diff --git a/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected b/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected rename to src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_values/ParenthesizedType.ts.expected b/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/ParenthesizedType.ts.expected rename to src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md diff --git a/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected b/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/PromiseOfPromise.ts.expected rename to src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md diff --git a/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected b/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected rename to src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md diff --git a/src/tests/fixtures/field_values/RenamedType.ts.expected b/src/tests/fixtures/field_values/RenamedType.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/RenamedType.ts.expected rename to src/tests/fixtures/field_values/RenamedType.ts.expected.md diff --git a/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected b/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected rename to src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md diff --git a/src/tests/fixtures/field_values/StringField.ts.expected b/src/tests/fixtures/field_values/StringField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/StringField.ts.expected rename to src/tests/fixtures/field_values/StringField.ts.expected.md diff --git a/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected b/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected rename to src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md diff --git a/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected b/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected rename to src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md diff --git a/src/tests/fixtures/field_values/UnionField.ts.expected b/src/tests/fixtures/field_values/UnionField.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/UnionField.ts.expected rename to src/tests/fixtures/field_values/UnionField.ts.expected.md diff --git a/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected b/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected rename to src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md diff --git a/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected b/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md similarity index 100% rename from src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected rename to src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md diff --git a/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected b/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected rename to src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/complexMutualReferences.ts.expected b/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/complexMutualReferences.ts.expected rename to src/tests/fixtures/generics/complexMutualReferences.ts.expected.md diff --git a/src/tests/fixtures/generics/connection.ts.expected b/src/tests/fixtures/generics/connection.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/connection.ts.expected rename to src/tests/fixtures/generics/connection.ts.expected.md diff --git a/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected b/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected rename to src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md diff --git a/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected b/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected rename to src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md diff --git a/src/tests/fixtures/generics/edge.ts.expected b/src/tests/fixtures/generics/edge.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/edge.ts.expected rename to src/tests/fixtures/generics/edge.ts.expected.md diff --git a/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected b/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected rename to src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/genericInputType.ts.expected b/src/tests/fixtures/generics/genericInputType.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericInputType.ts.expected rename to src/tests/fixtures/generics/genericInputType.ts.expected.md diff --git a/src/tests/fixtures/generics/genericInterface.ts.expected b/src/tests/fixtures/generics/genericInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericInterface.ts.expected rename to src/tests/fixtures/generics/genericInterface.ts.expected.md diff --git a/src/tests/fixtures/generics/genericOverArg.ts.expected b/src/tests/fixtures/generics/genericOverArg.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericOverArg.ts.expected rename to src/tests/fixtures/generics/genericOverArg.ts.expected.md diff --git a/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected b/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected rename to src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md diff --git a/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected b/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected rename to src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected b/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected rename to src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected b/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericTypeUsingClass.ts.expected rename to src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md diff --git a/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected b/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected rename to src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md diff --git a/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected b/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected rename to src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/multiparamGeneric.ts.expected b/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/multiparamGeneric.ts.expected rename to src/tests/fixtures/generics/multiparamGeneric.ts.expected.md diff --git a/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected b/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/names/skippedTypeParam.ts.expected rename to src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md diff --git a/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected b/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected rename to src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md diff --git a/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected b/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected rename to src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected b/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected rename to src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/result.ts.expected b/src/tests/fixtures/generics/result.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/result.ts.expected rename to src/tests/fixtures/generics/result.ts.expected.md diff --git a/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected b/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected rename to src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected b/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected rename to src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md diff --git a/src/tests/fixtures/generics/scalarWithGeneric.ts.expected b/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/scalarWithGeneric.ts.expected rename to src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md diff --git a/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected b/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected rename to src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected b/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected rename to src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected b/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected rename to src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md diff --git a/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected b/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected rename to src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md diff --git a/src/tests/fixtures/headers/customHeaders.ts.expected b/src/tests/fixtures/headers/customHeaders.ts.expected.md similarity index 100% rename from src/tests/fixtures/headers/customHeaders.ts.expected rename to src/tests/fixtures/headers/customHeaders.ts.expected.md diff --git a/src/tests/fixtures/headers/multilineHeader.ts.expected b/src/tests/fixtures/headers/multilineHeader.ts.expected.md similarity index 100% rename from src/tests/fixtures/headers/multilineHeader.ts.expected rename to src/tests/fixtures/headers/multilineHeader.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected b/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected rename to src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected b/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected rename to src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected rename to src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected b/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected rename to src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected b/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected rename to src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputType.ts.expected b/src/tests/fixtures/input_types/InputType.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputType.ts.expected rename to src/tests/fixtures/input_types/InputType.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeInterface.ts.expected b/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeInterface.ts.expected rename to src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected b/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected rename to src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected b/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected rename to src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected b/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected rename to src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected b/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected rename to src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected b/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected rename to src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md diff --git a/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected b/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected rename to src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md diff --git a/src/tests/fixtures/input_types/RenamedInputType.ts.expected b/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/RenamedInputType.ts.expected rename to src/tests/fixtures/input_types/RenamedInputType.ts.expected.md diff --git a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected rename to src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md diff --git a/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected b/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected rename to src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md diff --git a/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected b/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected rename to src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md diff --git a/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected b/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/ImplementsInterface.ts.expected rename to src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md diff --git a/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected b/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected rename to src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md diff --git a/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected b/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected rename to src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md diff --git a/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected b/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected rename to src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected b/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected rename to src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected b/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected rename to src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected b/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected rename to src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected b/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected rename to src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected b/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected rename to src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected b/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected rename to src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected b/src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected deleted file mode 100644 index 74250ec3..00000000 --- a/src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected +++ /dev/null @@ -1,25 +0,0 @@ ------------------ -INPUT ------------------ -// { "tsVersion": "5.0.2" } -// Note: Node is a built in class. -/** @gqlInterface */ -interface Node { - /** @gqlField */ - id: string; -} - ------------------ -OUTPUT ------------------ -src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts:4:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. - - Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces - -4 interface Node { - ~~~~ - - node_modules/.pnpm/typescript@5.0.2/node_modules/typescript/lib/lib.dom.d.ts:10247:11 - 10247 interface Node extends EventTarget { - ~~~~ - Other declaration diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMergedIntoNode.invalid.ts.expected.md new file mode 100644 index 00000000..e69de29b diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected b/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected rename to src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected b/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected rename to src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected b/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected rename to src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected b/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected rename to src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md diff --git a/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected b/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected rename to src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md diff --git a/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected b/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected rename to src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md diff --git a/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected b/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected rename to src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md diff --git a/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected b/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected rename to src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md diff --git a/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected b/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected rename to src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected b/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected rename to src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/genericType.invalid.ts.expected b/src/tests/fixtures/locate/genericType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/genericType.invalid.ts.expected rename to src/tests/fixtures/locate/genericType.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected b/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/genericTypeField.invalid.ts.expected rename to src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/inputType.invalid.ts.expected b/src/tests/fixtures/locate/inputType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/inputType.invalid.ts.expected rename to src/tests/fixtures/locate/inputType.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected b/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/inputTypeField.invalid.ts.expected rename to src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/interface.invalid.ts.expected b/src/tests/fixtures/locate/interface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/interface.invalid.ts.expected rename to src/tests/fixtures/locate/interface.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected b/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected rename to src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/notFoundField.invalid.ts.expected b/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/notFoundField.invalid.ts.expected rename to src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/notFoundType.invalid.ts.expected b/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/notFoundType.invalid.ts.expected rename to src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/type.invalid.ts.expected b/src/tests/fixtures/locate/type.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/type.invalid.ts.expected rename to src/tests/fixtures/locate/type.invalid.ts.expected.md diff --git a/src/tests/fixtures/locate/typeField.invalid.ts.expected b/src/tests/fixtures/locate/typeField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/locate/typeField.invalid.ts.expected rename to src/tests/fixtures/locate/typeField.invalid.ts.expected.md diff --git a/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected b/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md similarity index 100% rename from src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected rename to src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected b/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected rename to src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected rename to src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected b/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected b/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected b/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected rename to src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected b/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected rename to src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected b/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected rename to src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md diff --git a/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected b/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected rename to src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md diff --git a/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected b/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected rename to src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md diff --git a/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected b/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected rename to src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md diff --git a/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected b/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md similarity index 100% rename from src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected rename to src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md diff --git a/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected b/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected rename to src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected b/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md similarity index 100% rename from src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected rename to src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected b/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected rename to src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected b/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected rename to src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md diff --git a/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected b/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md similarity index 100% rename from src/tests/fixtures/semantic_nullability/semanticNull.ts.expected rename to src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md diff --git a/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected b/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected rename to src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md diff --git a/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected b/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md similarity index 100% rename from src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected rename to src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md diff --git a/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected b/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md similarity index 100% rename from src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected rename to src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md diff --git a/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected b/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected rename to src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md diff --git a/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected b/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md similarity index 100% rename from src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected rename to src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md diff --git a/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected b/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected rename to src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md diff --git a/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected b/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md similarity index 100% rename from src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected rename to src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md diff --git a/src/tests/fixtures/todo/userExample.ts.expected b/src/tests/fixtures/todo/userExample.ts.expected.md similarity index 100% rename from src/tests/fixtures/todo/userExample.ts.expected rename to src/tests/fixtures/todo/userExample.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/queryField.ts.expected b/src/tests/fixtures/top_level_fields/queryField.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/queryField.ts.expected rename to src/tests/fixtures/top_level_fields/queryField.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected b/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected rename to src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected b/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected rename to src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected b/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected rename to src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected b/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected rename to src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected b/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected rename to src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/rootFields.ts.expected b/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/rootFields.ts.expected rename to src/tests/fixtures/top_level_fields/rootFields.ts.expected.md diff --git a/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected b/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected rename to src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected b/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected rename to src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected b/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected rename to src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected b/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected rename to src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected b/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected rename to src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected b/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected rename to src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected b/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected rename to src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/RenamedType.ts.expected b/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/RenamedType.ts.expected rename to src/tests/fixtures/type_definitions/RenamedType.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected b/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected rename to src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected b/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected rename to src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected b/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected rename to src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected b/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected rename to src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected b/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected rename to src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected rename to src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected rename to src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected rename to src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected b/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected rename to src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected b/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected b/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md diff --git a/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected b/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected rename to src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected b/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected rename to src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected b/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/MethodTypename.invalid.ts.expected rename to src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected b/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertySignatureTypename.ts.expected rename to src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected rename to src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected rename to src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected rename to src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypename.ts.expected b/src/tests/fixtures/typename/PropertyTypename.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypename.ts.expected rename to src/tests/fixtures/typename/PropertyTypename.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected rename to src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected rename to src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected rename to src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected rename to src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected rename to src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected rename to src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md diff --git a/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected b/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected rename to src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected b/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected rename to src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionType.ts.expected b/src/tests/fixtures/unions/DefineUnionType.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionType.ts.expected rename to src/tests/fixtures/unions/DefineUnionType.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected b/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected rename to src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected b/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected rename to src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected b/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected rename to src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected b/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected rename to src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md diff --git a/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected b/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected rename to src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md diff --git a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected rename to src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md diff --git a/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected b/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected rename to src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md diff --git a/src/tests/fixtures/unions/UnionWithDescription.ts.expected b/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md similarity index 100% rename from src/tests/fixtures/unions/UnionWithDescription.ts.expected rename to src/tests/fixtures/unions/UnionWithDescription.ts.expected.md diff --git a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected rename to src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md diff --git a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected rename to src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md diff --git a/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected b/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected rename to src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md diff --git a/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected b/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected rename to src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md diff --git a/src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected b/src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected deleted file mode 100644 index f4edcfd8..00000000 --- a/src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected +++ /dev/null @@ -1,19 +0,0 @@ ------------------ -INPUT ------------------ -// { "reportTypeScriptTypeErrors": true, "tsVersion": "5.0.2" } -/** @gqlType */ -class Foo { - /** @gqlField */ - someField(): string { - return 10; - } -} - ------------------ -OUTPUT ------------------ -src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts:6:5 - error TS2322: Type 'number' is not assignable to type 'string'. - -6 return 10; - ~~~~~~~~~~ diff --git a/src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected.md b/src/tests/fixtures/user_error/TypeErrorWithTypeCheckingEnabled.ts.expected.md new file mode 100644 index 00000000..e69de29b diff --git a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md similarity index 100% rename from src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected rename to src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md diff --git a/src/tests/integrationFixtures/aliasedMethod/index.ts.expected b/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/aliasedMethod/index.ts.expected rename to src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md diff --git a/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected b/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/complexDefaultInput/index.ts.expected rename to src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md diff --git a/src/tests/integrationFixtures/complexPlurals/index.ts.expected b/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/complexPlurals/index.ts.expected rename to src/tests/integrationFixtures/complexPlurals/index.ts.expected.md diff --git a/src/tests/integrationFixtures/connectionExample/index.ts.expected b/src/tests/integrationFixtures/connectionExample/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/connectionExample/index.ts.expected rename to src/tests/integrationFixtures/connectionExample/index.ts.expected.md diff --git a/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected b/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/customScalarSerialization/index.ts.expected rename to src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md diff --git a/src/tests/integrationFixtures/deprecated/index.ts.expected b/src/tests/integrationFixtures/deprecated/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/deprecated/index.ts.expected rename to src/tests/integrationFixtures/deprecated/index.ts.expected.md diff --git a/src/tests/integrationFixtures/derivedContext/index.ts.expected b/src/tests/integrationFixtures/derivedContext/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/derivedContext/index.ts.expected rename to src/tests/integrationFixtures/derivedContext/index.ts.expected.md diff --git a/src/tests/integrationFixtures/enumDefault/index.ts.expected b/src/tests/integrationFixtures/enumDefault/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/enumDefault/index.ts.expected rename to src/tests/integrationFixtures/enumDefault/index.ts.expected.md diff --git a/src/tests/integrationFixtures/enumExport/index.ts.expected b/src/tests/integrationFixtures/enumExport/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/enumExport/index.ts.expected rename to src/tests/integrationFixtures/enumExport/index.ts.expected.md diff --git a/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected b/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected rename to src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md diff --git a/src/tests/integrationFixtures/functionField/index.ts.expected b/src/tests/integrationFixtures/functionField/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/functionField/index.ts.expected rename to src/tests/integrationFixtures/functionField/index.ts.expected.md diff --git a/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected b/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected rename to src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md diff --git a/src/tests/integrationFixtures/getAcessor/index.ts.expected b/src/tests/integrationFixtures/getAcessor/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/getAcessor/index.ts.expected rename to src/tests/integrationFixtures/getAcessor/index.ts.expected.md diff --git a/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected b/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected rename to src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md diff --git a/src/tests/integrationFixtures/killsParentOnException/index.ts.expected b/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/killsParentOnException/index.ts.expected rename to src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md diff --git a/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected b/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected rename to src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md diff --git a/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected b/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected rename to src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md diff --git a/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected b/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected rename to src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md diff --git a/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected b/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected rename to src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md diff --git a/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected b/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected rename to src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md diff --git a/src/tests/integrationFixtures/numericID/index.ts.expected b/src/tests/integrationFixtures/numericID/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/numericID/index.ts.expected rename to src/tests/integrationFixtures/numericID/index.ts.expected.md diff --git a/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected b/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected rename to src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md diff --git a/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected b/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected rename to src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md diff --git a/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected b/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/promiseOfPromise/index.ts.expected rename to src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md diff --git a/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected b/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected rename to src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md diff --git a/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected b/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected rename to src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md diff --git a/src/tests/integrationFixtures/skipInclude/index.ts.expected b/src/tests/integrationFixtures/skipInclude/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/skipInclude/index.ts.expected rename to src/tests/integrationFixtures/skipInclude/index.ts.expected.md diff --git a/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected b/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md similarity index 100% rename from src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected rename to src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md From bf001eb9c6189194dc0d38cbd9c85d6829b9777f Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 9 Dec 2025 22:12:00 -0800 Subject: [PATCH 2/6] Improve snapshot markdown formatting --- src/tests/Markdown.ts | 49 +++++++++++++++++++ src/tests/TestRunner.ts | 18 ++++--- .../empty.json.expected.md | 16 +++--- .../experimentalField.json.expected.md | 16 +++--- .../invlaidKey.invalid.json.expected.md | 14 +++--- .../multiLineHeader.json.expected.md | 16 +++--- ...ultiLineNonHeader.invalid.json.expected.md | 14 +++--- ...llableFieldIsNull.invalid.json.expected.md | 14 +++--- ...eferencesNonGqlType.invalid.ts.expected.md | 14 +++--- .../ArgWithNoType.invalid.ts.expected.md | 14 +++--- .../ArgumentWithDescription.ts.expected.md | 14 +++--- ...yncIterableArgument.invalid.ts.expected.md | 14 +++--- .../CustomScalarArgument.ts.expected.md | 14 +++--- .../DeprecatedArgument.ts.expected.md | 14 +++--- ...tedRequiredArgument.invalid.ts.expected.md | 14 +++--- .../GqlTypeUsedAsPositionalArg.ts.expected.md | 14 +++--- ...sTypedAsTypeLiteral.invalid.ts.expected.md | 14 +++--- .../NoArgsWithNever.invalid.ts.expected.md | 14 +++--- .../NoArgsWithUnknown.invalid.ts.expected.md | 14 +++--- .../NoTypeAnnotation.invalid.ts.expected.md | 14 +++--- ...lableArgumentErrors.invalid.ts.expected.md | 14 +++--- .../NullableArguments.ts.expected.md | 14 +++--- ...jectLiteralArgument.invalid.ts.expected.md | 14 +++--- .../OpaqueArgType.invalid.ts.expected.md | 14 +++--- .../arguments/OptionalArgument.ts.expected.md | 14 +++--- ...NonNullableArgument.invalid.ts.expected.md | 14 +++--- ...NullableArgumentWithDefault.ts.expected.md | 14 +++--- ...ositionalArgAndArgs.invalid.ts.expected.md | 14 +++--- ...tionalArgDeprecatedOptional.ts.expected.md | 14 +++--- ...nalArgDeprecatedWithDefault.ts.expected.md | 14 +++--- .../PositionalArgOptional.ts.expected.md | 14 +++--- ...OptionalNotNullable.invalid.ts.expected.md | 14 +++--- .../PositionalArgWithDefault.ts.expected.md | 14 +++--- ...ositionalArgWithDescription.ts.expected.md | 14 +++--- .../PromiseArgument.invalid.ts.expected.md | 14 +++--- .../arguments/StringArgument.ts.expected.md | 14 +++--- ...upleLiteralArgument.invalid.ts.expected.md | 14 +++--- .../FloatField.ts.expected.md | 14 +++--- .../FloatFieldAliasedImport.ts.expected.md | 14 +++--- .../built_in_scalars/IdField.ts.expected.md | 14 +++--- .../built_in_scalars/IntField.ts.expected.md | 14 +++--- ...entFollowsDecorator.invalid.ts.expected.md | 14 +++--- ...etachedBlockComment.invalid.ts.expected.md | 14 +++--- ...NotJSDocWithoutStar.invalid.ts.expected.md | 14 +++--- ...tWithInvalidTagName.invalid.ts.expected.md | 14 +++--- ...mentWithKillsParent.invalid.ts.expected.md | 14 +++--- ...kCommentWithoutStar.invalid.ts.expected.md | 14 +++--- ...lidTagInLinecomment.invalid.ts.expected.md | 14 +++--- .../lineComment.invalid.ts.expected.md | 14 +++--- ...eCommentWrongCasing.invalid.ts.expected.md | 14 +++--- ...onJSDocBlockComment.invalid.ts.expected.md | 14 +++--- ...erIsArrayWithNumber.invalid.ts.expected.md | 14 +++--- ...importModuleSpecifierEnding.ts.expected.md | 14 +++--- .../invalidKey.invalid.ts.expected.md | 14 +++--- ...multipleInvalidKeys.invalid.ts.expected.md | 14 +++--- .../nonNullableIsNull.invalid.ts.expected.md | 14 +++--- .../DefineCustomScalar.ts.expected.md | 14 +++--- ...CustomScalarWithDescription.ts.expected.md | 14 +++--- .../DefineRenamedCustomScalar.ts.expected.md | 14 +++--- .../custom_scalars/SpecifiedBy.ts.expected.md | 14 +++--- ...ByMissingUrlinvalid.invalid.ts.expected.md | 14 +++--- ...pecifiedByOldSyntax.invalid.ts.expected.md | 14 +++--- .../SpecifiedByOnEnum.invalid.ts.expected.md | 14 +++--- ...AttachedToWrongNode.invalid.ts.expected.md | 14 +++--- .../DefaultArgumentArray.ts.expected.md | 14 +++--- ...tArrayValuesInvalid.invalid.ts.expected.md | 14 +++--- ...faultArgumentBooleanLiteral.ts.expected.md | 14 +++--- .../DefaultArgumentNullLiteral.ts.expected.md | 14 +++--- ...efaultArgumentNumberLiteral.ts.expected.md | 14 +++--- ...efaultArgumentObjectLiteral.ts.expected.md | 14 +++--- ...DynamicPropertyName.invalid.ts.expected.md | 14 +++--- ...iteralInterpolation.invalid.ts.expected.md | 14 +++--- ...tiplePropertyErrors.invalid.ts.expected.md | 14 +++--- ...ObjectLiteralSpread.invalid.ts.expected.md | 14 +++--- ...DefaultArgumentPropertyName.ts.expected.md | 14 +++--- ...efaultArgumentStringLiteral.ts.expected.md | 14 +++--- ...umentStringLiteralBackticks.ts.expected.md | 14 +++--- ...ckticksInterpolated.invalid.ts.expected.md | 14 +++--- ...LiteralDefaultValue.invalid.ts.expected.md | 14 +++--- ...icContextDependency.invalid.ts.expected.md | 14 +++--- ...DependencyWithChain.invalid.ts.expected.md | 14 +++--- ...derivedContextChain.invalid.ts.expected.md | 14 +++--- ...ContextNoReturnType.invalid.ts.expected.md | 14 +++--- ...tNonNamedReturnType.invalid.ts.expected.md | 14 +++--- ...vedContextUsedMultipleTimes.ts.expected.md | 14 +++--- ...vedContextsSameType.invalid.ts.expected.md | 14 +++--- .../simpleDerivedContext.ts.expected.md | 14 +++--- .../simpleDerivedContextNoArgs.ts.expected.md | 14 +++--- ...textReadsRandomType.invalid.ts.expected.md | 14 +++--- ...ontextUndefinedType.invalid.ts.expected.md | 14 +++--- ...BlankLinesAroundDescription.ts.expected.md | 14 +++--- .../BlankLinesFollowTypeTag.ts.expected.md | 14 +++--- ...ptionFollowsTypeTag.invalid.ts.expected.md | 14 +++--- ...tionOnLineOfTypeTag.invalid.ts.expected.md | 14 +++--- .../MultilineDescription.ts.expected.md | 14 +++--- ...llowedByDescription.invalid.ts.expected.md | 14 +++--- .../defineCustomDirective.ts.expected.md | 14 +++--- ...iveAdditionalArgsAreIgnored.ts.expected.md | 14 +++--- ...eCustomDirectiveArgsIsNever.ts.expected.md | 14 +++--- ...neCustomDirectiveCustomName.ts.expected.md | 14 +++--- ...tiveLocationInvalid.invalid.ts.expected.md | 14 +++--- ...mDirectiveMultipleLocations.ts.expected.md | 14 +++--- ...DirectiveNoLocation.invalid.ts.expected.md | 14 +++--- ...ectiveOnIsNotString.invalid.ts.expected.md | 14 +++--- ...rectiveReadsContext.invalid.ts.expected.md | 14 +++--- ...neCustomDirectiveRepeatable.ts.expected.md | 14 +++--- ...fineCustomDirectiveWithArgs.ts.expected.md | 14 +++--- ...mDirectiveWithArgsNonScalar.ts.expected.md | 14 +++--- ...irectiveWithArgsWithDefault.ts.expected.md | 14 +++--- ...tiveArgFieldInvalid.invalid.ts.expected.md | 14 +++--- ...tiveArgInvalidOneOf.invalid.ts.expected.md | 14 +++--- ...eIsStringLiteralWithDefault.ts.expected.md | 14 +++--- .../directiveNotConst.invalid.ts.expected.md | 14 +++--- ...rectiveOnArgumentDefinition.ts.expected.md | 14 +++--- .../directives/directiveOnEnum.ts.expected.md | 14 +++--- .../directiveOnEnumValue.ts.expected.md | 14 +++--- .../directiveOnFieldDefinition.ts.expected.md | 14 +++--- ...ctiveOnInputFieldDefinition.ts.expected.md | 14 +++--- .../directiveOnInputObjectType.ts.expected.md | 14 +++--- .../directiveOnInterface.ts.expected.md | 14 +++--- .../directiveOnObjectType.ts.expected.md | 14 +++--- .../directiveOnScalar.ts.expected.md | 14 +++--- .../directiveOnUnion.ts.expected.md | 14 +++--- ...UsedWithInvalidArgs.invalid.ts.expected.md | 15 +++--- ...tiveWithSyntaxError.invalid.ts.expected.md | 14 +++--- ...gqlAnnotateOnNonGqlDocblock.ts.expected.md | 14 +++--- ...edDirectiveWithArgs.invalid.ts.expected.md | 14 +++--- ...definedDirectiveWithoutArgs.ts.expected.md | 14 +++--- .../DeprecatedEnumVariant.ts.expected.md | 14 +++--- src/tests/fixtures/enums/Enum.ts.expected.md | 14 +++--- .../enums/EnumFromUnionType.ts.expected.md | 14 +++--- ...UnionTypeNotLiteral.invalid.ts.expected.md | 14 +++--- ...ypeNotStringLiteral.invalid.ts.expected.md | 14 +++--- ...romUnionTypeOfStringLiteral.ts.expected.md | 14 +++--- ...romUnionTypeWithDescription.ts.expected.md | 14 +++--- ...WithEmitEnumsConfig.invalid.ts.expected.md | 14 +++--- ...mNotValidIdentifier.invalid.ts.expected.md | 14 +++--- ...numValuesDifferentThanNames.ts.expected.md | 14 +++--- .../enums/EnumWithDescription.ts.expected.md | 14 +++--- ...mWithVariantWithDescription.ts.expected.md | 14 +++--- ...plicitlyNumericEnum.invalid.ts.expected.md | 14 +++--- ...WithEmitEnumsConfig.invalid.ts.expected.md | 14 +++--- ...plicitlyNumericEnum.invalid.ts.expected.md | 14 +++--- .../enums/NonNullEnumDefault.ts.expected.md | 14 +++--- ...ullEnumDefaultInInputObject.ts.expected.md | 14 +++--- .../NonNullPluralEnumDefaults.ts.expected.md | 14 +++--- .../enums/NonNullTsEnumDefault.ts.expected.md | 14 +++--- ...lTsEnumDefaultStringLiteral.ts.expected.md | 14 +++--- ...llowedWithEmitEnums.invalid.ts.expected.md | 14 +++--- .../examples/playground.ts.expected.md | 14 +++--- .../fixtures/examples/readme.ts.expected.md | 14 +++--- ...ddStringFieldToEnum.invalid.ts.expected.md | 14 +++--- .../addStringFieldToInterface.ts.expected.md | 14 +++--- ...rfaceImplementedByInterface.ts.expected.md | 14 +++--- ...eldToInterfaceTwice.invalid.ts.expected.md | 14 +++--- ...ringFieldToNonGrats.invalid.ts.expected.md | 14 +++--- ...xistsOnConcreteType.invalid.ts.expected.md | 14 +++--- ...plementingInterface.invalid.ts.expected.md | 14 +++--- .../addDeprecatedField.ts.expected.md | 14 +++--- .../addFieldWithArguments.ts.expected.md | 14 +++--- .../addFieldWithDescription.ts.expected.md | 14 +++--- .../addRenamedFieldToSomeType.ts.expected.md | 14 +++--- .../addStringFieldToSomeType.ts.expected.md | 14 +++--- .../extend_type/defaultExport.ts.expected.md | 14 +++--- ...dAsArrowFunctionLet.invalid.ts.expected.md | 14 +++--- ...FunctionNotExported.invalid.ts.expected.md | 14 +++--- ...dAsArrowFunctionVar.invalid.ts.expected.md | 14 +++--- ...ieldAsExportedArrowFunction.ts.expected.md | 14 +++--- ...ArrowFunctionPositionalArgs.ts.expected.md | 14 +++--- ...sExportedAsyncArrowFunction.ts.expected.md | 14 +++--- ...edMultipleVariables.invalid.ts.expected.md | 14 +++--- ...ldAsExportedNothing.invalid.ts.expected.md | 14 +++--- ...eldAsExportedNumber.invalid.ts.expected.md | 14 +++--- ...dOnTypeDefinedWithInterface.ts.expected.md | 14 +++--- .../interfaceFirstArgumentType.ts.expected.md | 14 +++--- ...issingFirstArgument.invalid.ts.expected.md | 14 +++--- ...ngFirstArgumentType.invalid.ts.expected.md | 14 +++--- ...asFirstArgumentType.invalid.ts.expected.md | 14 +++--- ...QLFirstArgumentType.invalid.ts.expected.md | 14 +++--- .../notExported.invalid.ts.expected.md | 14 +++--- .../optionalModelType.ts.expected.md | 14 +++--- .../DeprecatedMethodField.ts.expected.md | 14 +++--- .../DeprecatedPropertyField.ts.expected.md | 14 +++--- .../FieldAsSetter.invalid.ts.expected.md | 14 +++--- .../FieldAsStaticClassMethod.ts.expected.md | 14 +++--- ...MethodInNestedScope.invalid.ts.expected.md | 14 +++--- ...tedScopeButExported.invalid.ts.expected.md | 14 +++--- ...ssMethodNotExported.invalid.ts.expected.md | 14 +++--- ...ticClassMethodOnNonGqlClass.ts.expected.md | 14 +++--- ...sMethodOnUnnamedNonGqlClass.ts.expected.md | 14 +++--- ...hodWithClassAsDefaultExport.ts.expected.md | 14 +++--- ...DefinedOnNonGqlType.invalid.ts.expected.md | 14 +++--- ...eldOnArbitraryParam.invalid.ts.expected.md | 14 +++--- ...dTagOnIncorrectNode.invalid.ts.expected.md | 14 +++--- ...nionOfMultipleTypes.invalid.ts.expected.md | 14 +++--- .../GetAcessorField.ts.expected.md | 14 +++--- ...hodFieldMissingType.invalid.ts.expected.md | 14 +++--- .../MethodSignatureOnInterface.ts.expected.md | 14 +++--- ...eFieldsAsStaticClassMethods.ts.expected.md | 14 +++--- .../ParameterPropertyField.ts.expected.md | 14 +++--- ...FieldBindingPattern.invalid.ts.expected.md | 14 +++--- ...eterPropertyFieldDeprecated.ts.expected.md | 14 +++--- ...ertyFieldNoModifier.invalid.ts.expected.md | 14 +++--- ...PropertyFieldNoType.invalid.ts.expected.md | 14 +++--- ...ameterPropertyFieldReadOnly.ts.expected.md | 14 +++--- ...ieldReadOnlyPrivate.invalid.ts.expected.md | 14 +++--- ...rameterPropertyFieldRenamed.ts.expected.md | 14 +++--- ...ropertyFieldWithDescription.ts.expected.md | 14 +++--- ...otectedFieldMethods.invalid.ts.expected.md | 14 +++--- ...rtyFieldMissingType.invalid.ts.expected.md | 14 +++--- .../PublicFieldMethod.ts.expected.md | 14 +++--- ...renceNonGraphQLType.invalid.ts.expected.md | 14 +++--- ...erenceUndefinedType.invalid.ts.expected.md | 14 +++--- .../RenamedField.ts.expected.md | 14 +++--- .../RenamedFieldWithArgs.ts.expected.md | 14 +++--- ...RenamedFieldWithDescription.ts.expected.md | 14 +++--- .../StringFieldWithDescription.ts.expected.md | 14 +++--- ...ionFieldNotExported.invalid.ts.expected.md | 14 +++--- .../field_values/ArrayField.ts.expected.md | 14 +++--- .../ArrayOfPromises.ts.expected.md | 14 +++--- .../ArrayShorthandField.ts.expected.md | 14 +++--- .../ArrayWithNullableItems.ts.expected.md | 14 +++--- .../AsyncPromiseField.ts.expected.md | 14 +++--- .../field_values/BooleanField.ts.expected.md | 14 +++--- .../field_values/CustomScalar.ts.expected.md | 14 +++--- .../DuplicateFields.invalid.ts.expected.md | 14 +++--- ...esNotMatchInterface.invalid.ts.expected.md | 14 +++--- .../field_values/KitchenSink.ts.expected.md | 14 +++--- .../field_values/LinkedField.ts.expected.md | 14 +++--- .../LinkedFieldWithTypeArg.ts.expected.md | 14 +++--- .../field_values/MaybePromise.ts.expected.md | 14 +++--- .../OptionalFields.ts.expected.md | 14 +++--- .../OptionalProperty.ts.expected.md | 14 +++--- ...lsParentOnException.invalid.ts.expected.md | 14 +++--- .../ParenthesizedType.ts.expected.md | 14 +++--- .../PromiseOfPromise.ts.expected.md | 14 +++--- .../ReadonlyArrayField.ts.expected.md | 14 +++--- .../field_values/RenamedType.ts.expected.md | 14 +++--- .../RenamedTypeOutOfOrder.ts.expected.md | 14 +++--- .../field_values/StringField.ts.expected.md | 14 +++--- ...FieldKillsParentOnException.ts.expected.md | 14 +++--- ...bleByDefaultEnables.invalid.ts.expected.md | 14 +++--- .../field_values/UnionField.ts.expected.md | 14 +++--- .../NonNullablePromise.ts.expected.md | 14 +++--- .../NullablePromise.ts.expected.md | 14 +++--- ...rrayPassedToGeneric.invalid.ts.expected.md | 14 +++--- .../complexMutualReferences.ts.expected.md | 14 +++--- .../generics/connection.ts.expected.md | 14 +++--- .../connectionEdgeAsGeneric.ts.expected.md | 14 +++--- .../defineFieldOnGeneric.ts.expected.md | 14 +++--- .../fixtures/generics/edge.ts.expected.md | 14 +++--- .../enumWithGeneric.invalid.ts.expected.md | 14 +++--- .../generics/genericInputType.ts.expected.md | 14 +++--- .../generics/genericInterface.ts.expected.md | 14 +++--- .../generics/genericOverArg.ts.expected.md | 14 +++--- ...nericReferencedMoreThanOnce.ts.expected.md | 14 +++--- ...peUsedAsUnionMember.invalid.ts.expected.md | 14 +++--- ...nMemberViaTypeParam.invalid.ts.expected.md | 14 +++--- .../genericTypeUsingClass.ts.expected.md | 14 +++--- .../genericTypeUsingInterface.ts.expected.md | 14 +++--- ...ngGqlGenericTypeArg.invalid.ts.expected.md | 14 +++--- .../generics/multiparamGeneric.ts.expected.md | 14 +++--- .../names/skippedTypeParam.ts.expected.md | 14 +++--- ...ippedTypeParamPassesLiteral.ts.expected.md | 14 +++--- ...peToInputType.input.invalid.ts.expected.md | 14 +++--- ...encingMethodGeneric.invalid.ts.expected.md | 14 +++--- .../fixtures/generics/result.ts.expected.md | 14 +++--- ...rPassedAsGenericArg.invalid.ts.expected.md | 14 +++--- ...larPassedAsNonGqlGenericArg.ts.expected.md | 14 +++--- .../generics/scalarWithGeneric.ts.expected.md | 14 +++--- ...erfaceFromTypeParam.invalid.ts.expected.md | 14 +++--- ...ImplementsInterface.invalid.ts.expected.md | 14 +++--- .../genericTypeMemberOfUnion.ts.expected.md | 14 +++--- ...sedAsGenericTypeArg.invalid.ts.expected.md | 14 +++--- .../headers/customHeaders.ts.expected.md | 14 +++--- .../headers/multilineHeader.ts.expected.md | 14 +++--- .../oneOfDeprecated.invalid.ts.expected.md | 14 +++--- .../oneOfFieldIsNullable.ts.expected.md | 14 +++--- .../oneOfFieldIsOptional.ts.expected.md | 14 +++--- ...ssingTypeAnnotation.invalid.ts.expected.md | 14 +++--- .../oneOfFieldTypeList.ts.expected.md | 14 +++--- ...neOfFieldTypeListOfNullable.ts.expected.md | 14 +++--- ...FieldTypeNotGraphQL.invalid.ts.expected.md | 14 +++--- ...erHasMultipleFields.invalid.ts.expected.md | 14 +++--- ...eOfMemberHasNoField.invalid.ts.expected.md | 14 +++--- ...ionMemberNotLiteral.invalid.ts.expected.md | 14 +++--- .../oneOfWithFieldDescription.ts.expected.md | 14 +++--- ...thFieldDescriptionInsideObj.ts.expected.md | 14 +++--- .../oneOfWithTypeDescription.ts.expected.md | 14 +++--- .../simpleOneOf.ts.expected.md | 14 +++--- ...eOneOfDeprecatedTag.invalid.ts.expected.md | 14 +++--- ...ferencedInInputType.invalid.ts.expected.md | 14 +++--- ...DeprecatedInputType.invalid.ts.expected.md | 14 +++--- .../input_types/InputType.ts.expected.md | 14 +++--- .../InputTypeInterface.ts.expected.md | 14 +++--- ...peInterfaceFunction.invalid.ts.expected.md | 14 +++--- ...TypeInterfaceMethod.invalid.ts.expected.md | 14 +++--- ...tTypeInterfaceOptionalField.ts.expected.md | 14 +++--- ...terfacePromiseField.invalid.ts.expected.md | 14 +++--- ...TypeMergedInterface.invalid.ts.expected.md | 14 +++--- .../InputTypeOptionalField.ts.expected.md | 14 +++--- ...ferencingOutputType.invalid.ts.expected.md | 14 +++--- ...peReturnedFromField.invalid.ts.expected.md | 14 +++--- ...nputTypeWithDeprecatedField.ts.expected.md | 14 +++--- ...ecatedRequiredField.invalid.ts.expected.md | 14 +++--- .../InputTypeWithDescription.ts.expected.md | 14 +++--- ...putTypeWithFieldDescription.ts.expected.md | 14 +++--- .../RenamedInputType.ts.expected.md | 14 +++--- ...utFieldWithGqlField.invalid.ts.expected.md | 14 +++--- .../FieldReturnsInterface.ts.expected.md | 14 +++--- .../IgnoresExtendsClause.ts.expected.md | 14 +++--- .../ImplementsInterface.ts.expected.md | 14 +++--- ...mentsInterfaceWithTypeParam.ts.expected.md | 14 +++--- ...mplementsMultipleInterfaces.ts.expected.md | 14 +++--- .../ImplementsRenamedInterface.ts.expected.md | 14 +++--- ...finitionExtendsGqlInterface.ts.expected.md | 14 +++--- .../InterfaceExtendsInterface.ts.expected.md | 14 +++--- ...terfaceFieldWithDescription.ts.expected.md | 14 +++--- ...criptionThatDiffersFromType.ts.expected.md | 14 +++--- ...nterfaceImplementsInterface.ts.expected.md | 14 +++--- ...faceMergedIntoClass.invalid.ts.expected.md | 14 +++--- .../InterfaceMergedIntoObject.ts.expected.md | 14 +++--- ...erfaceMissingFields.invalid.ts.expected.md | 14 +++--- .../InterfaceWithCustomName.ts.expected.md | 14 +++--- ...nterfaceWithDeprecatedField.ts.expected.md | 14 +++--- .../InterfaceWithDescription.ts.expected.md | 14 +++--- .../MergedInterfaces.invalid.ts.expected.md | 14 +++--- ...AttachedToWrongNode.invalid.ts.expected.md | 14 +++--- ...tendInterfaceWithNonGqlType.ts.expected.md | 14 +++--- ...houtTypeOrInterface.invalid.ts.expected.md | 14 +++--- .../fieldOnScalar.invalid.ts.expected.md | 16 +++--- .../locate/genericType.invalid.ts.expected.md | 14 +++--- .../genericTypeField.invalid.ts.expected.md | 14 +++--- .../locate/inputType.invalid.ts.expected.md | 14 +++--- .../inputTypeField.invalid.ts.expected.md | 14 +++--- .../locate/interface.invalid.ts.expected.md | 14 +++--- ...lformedEntitySyntax.invalid.ts.expected.md | 16 +++--- .../notFoundField.invalid.ts.expected.md | 16 +++--- .../notFoundType.invalid.ts.expected.md | 16 +++--- .../locate/type.invalid.ts.expected.md | 14 +++--- .../locate/typeField.invalid.ts.expected.md | 14 +++--- .../fieldFollowedByDeprecated.ts.expected.md | 14 +++--- ...ClassMethodWithContextValue.ts.expected.md | 14 +++--- ...hodWithContextValueExported.ts.expected.md | 14 +++--- ...ntextValueInArgsPos.invalid.ts.expected.md | 14 +++--- .../ContextValueBeforeArgs.ts.expected.md | 14 +++--- ...ssingTypeAnnotation.invalid.ts.expected.md | 14 +++--- .../ContextValueOptional.ts.expected.md | 14 +++--- .../ContextValueReadTwice.ts.expected.md | 14 +++--- .../ContextValueSpread.invalid.ts.expected.md | 14 +++--- ...ValueTypeNotDefined.invalid.ts.expected.md | 14 +++--- ...textValueTypedAsAny.invalid.ts.expected.md | 14 +++--- ...xtValueTypedAsNever.invalid.ts.expected.md | 14 +++--- ...ValueTypedAsUnknown.invalid.ts.expected.md | 14 +++--- .../FunctionWithContextValue.ts.expected.md | 14 +++--- ...hodsReferencingContextValue.ts.expected.md | 14 +++--- ...leContextValuesUsed.invalid.ts.expected.md | 14 +++--- .../ClassMethodWithInfoValue.ts.expected.md | 14 +++--- .../FunctionWithInfoValue.ts.expected.md | 14 +++--- .../StaticMethodWithInfoValue.ts.expected.md | 14 +++--- ...esNotMatchInterface.invalid.ts.expected.md | 14 +++--- .../semanticNonNull.ts.expected.md | 14 +++--- ...esNotMatchInterface.invalid.ts.expected.md | 14 +++--- ...nticNonNullMatchesInterface.ts.expected.md | 14 +++--- .../semanticNull.ts.expected.md | 14 +++--- ...peWithAsyncIterable.invalid.ts.expected.md | 14 +++--- .../InterfaceWithAsyncIterable.ts.expected.md | 14 +++--- ...ptionClassWithAsyncIterable.ts.expected.md | 14 +++--- ...ssWithAsyncIterable.invalid.ts.expected.md | 14 +++--- ...ctionFieldWithAsyncIterable.ts.expected.md | 14 +++--- ...eWithVariantWithDescription.ts.expected.md | 14 +++--- .../todo/RedefineBuiltinScalar.ts.expected.md | 14 +++--- .../fixtures/todo/userExample.ts.expected.md | 14 +++--- .../queryField.ts.expected.md | 14 +++--- .../queryFieldOnMethod.invalid.ts.expected.md | 14 +++--- .../queryFieldOnStaticMethod.ts.expected.md | 14 +++--- .../queryFieldRenamed.ts.expected.md | 14 +++--- ...dWithExplicitlyDefinedQuery.ts.expected.md | 14 +++--- ...hFirstArgParentType.invalid.ts.expected.md | 14 +++--- .../rootFields.ts.expected.md | 14 +++--- ...eldNotAsyncIterable.invalid.ts.expected.md | 14 +++--- ...ssImplementsNonGqlInterface.ts.expected.md | 14 +++--- .../ClassMissingFields.invalid.ts.expected.md | 14 +++--- .../ClassWithDescription.ts.expected.md | 14 +++--- ...ithDescriptionAndCustomName.ts.expected.md | 14 +++--- .../ClassWithoutAName.invalid.ts.expected.md | 14 +++--- .../QueryAsClass.invalid.ts.expected.md | 14 +++--- .../RenamedType.ts.expected.md | 14 +++--- .../RenamedTypeHasDash.invalid.ts.expected.md | 14 +++--- .../RenamedTypeNewLine.invalid.ts.expected.md | 14 +++--- ...ypeStartsWithNumber.invalid.ts.expected.md | 14 +++--- ...ypeWithoutClassName.invalid.ts.expected.md | 14 +++--- ...AttachedToWrongNode.invalid.ts.expected.md | 14 +++--- ...finitionImplementsInterface.ts.expected.md | 14 +++--- ...ceWithDeprecatedTag.invalid.ts.expected.md | 14 +++--- ...mplementsMultipleInterfaces.ts.expected.md | 14 +++--- ...asIsArrayNotLiteral.invalid.ts.expected.md | 14 +++--- ...sIsNumberNotLiteral.invalid.ts.expected.md | 14 +++--- .../AliasOfUnknownDefinesType.ts.expected.md | 14 +++--- .../AliasType.ts.expected.md | 14 +++--- ...ImplementsInterface.invalid.ts.expected.md | 14 +++--- .../AliasWithDescription.ts.expected.md | 14 +++--- ...ithDescriptionAndCustomName.ts.expected.md | 14 +++--- ...ueryAsAliasOfObject.invalid.ts.expected.md | 14 +++--- ...yAsAliasOfUndefined.invalid.ts.expected.md | 14 +++--- .../QueryAsAliasOfUnknown.ts.expected.md | 14 +++--- .../RenamedType.ts.expected.md | 14 +++--- .../InterfaceType.ts.expected.md | 14 +++--- ...faceTypeExtendsGqlInterface.ts.expected.md | 14 +++--- ...ceWithDeprecatedTag.invalid.ts.expected.md | 14 +++--- ...faceTypeImplementsInterface.ts.expected.md | 14 +++--- .../InterfaceWithDescription.ts.expected.md | 14 +++--- ...ithDescriptionAndCustomName.ts.expected.md | 14 +++--- .../QueryFromInterface.invalid.ts.expected.md | 14 +++--- .../RenamedType.ts.expected.md | 14 +++--- ...AttachedToWrongNode.invalid.ts.expected.md | 14 +++--- ...ntorMissingTypename.invalid.ts.expected.md | 14 +++--- .../MethodTypename.invalid.ts.expected.md | 14 +++--- .../PropertySignatureTypename.ts.expected.md | 14 +++--- ...penameIncorrectName.invalid.ts.expected.md | 14 +++--- ...TypenameMissingType.invalid.ts.expected.md | 14 +++--- ...enameNonLiteralType.invalid.ts.expected.md | 14 +++--- .../typename/PropertyTypename.ts.expected.md | 14 +++--- ...esNotMatchClassName.invalid.ts.expected.md | 14 +++--- ...otMatchDeclaredName.invalid.ts.expected.md | 14 +++--- ...ToBeDeclaredAsConst.invalid.ts.expected.md | 14 +++--- ...laredAsExactlyConst.invalid.ts.expected.md | 14 +++--- ...penameNoInitializer.invalid.ts.expected.md | 14 +++--- ...onStringInitializer.invalid.ts.expected.md | 14 +++--- ...mberMissingTypename.invalid.ts.expected.md | 14 +++--- .../DefineUnionOfOneType.ts.expected.md | 14 +++--- .../unions/DefineUnionType.ts.expected.md | 14 +++--- ...ContainingInterface.invalid.ts.expected.md | 14 +++--- ...eferencingInputType.invalid.ts.expected.md | 14 +++--- ...eReferencingLiteral.invalid.ts.expected.md | 14 +++--- ...fineUnionTypeWithInterfaces.ts.expected.md | 14 +++--- ...neUnionTypeWithTypeLiterals.ts.expected.md | 14 +++--- ...ionAsMemberOfItself.invalid.ts.expected.md | 14 +++--- ...sMemberOfOtherUnion.invalid.ts.expected.md | 14 +++--- .../UnionWithDescription.ts.expected.md | 14 +++--- .../DuplicateOneOfTag.invalid.ts.expected.md | 14 +++--- .../GqlTagDoesNotExist.invalid.ts.expected.md | 14 +++--- .../InvalidSyntax.invalid.ts.expected.md | 15 +++--- ...ExceptionOnNonField.invalid.ts.expected.md | 15 +++--- .../WrongCaseGqlTag.invalid.ts.expected.md | 14 +++--- .../aliasedMethod/index.ts.expected.md | 16 +++--- .../complexDefaultInput/index.ts.expected.md | 16 +++--- .../complexPlurals/index.ts.expected.md | 16 +++--- .../connectionExample/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../deprecated/index.ts.expected.md | 16 +++--- .../derivedContext/index.ts.expected.md | 16 +++--- .../enumDefault/index.ts.expected.md | 16 +++--- .../enumExport/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../functionField/index.ts.expected.md | 16 +++--- .../functionFieldRenamed/index.ts.expected.md | 16 +++--- .../getAcessor/index.ts.expected.md | 16 +++--- .../inputTypeOneOf/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../nonNullEnumDefault/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../numericID/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../promiseOfPromise/index.ts.expected.md | 16 +++--- .../resolveTypeViaClass/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- .../skipInclude/index.ts.expected.md | 16 +++--- .../index.ts.expected.md | 16 +++--- 473 files changed, 3863 insertions(+), 2871 deletions(-) create mode 100644 src/tests/Markdown.ts diff --git a/src/tests/Markdown.ts b/src/tests/Markdown.ts new file mode 100644 index 00000000..8fe50a29 --- /dev/null +++ b/src/tests/Markdown.ts @@ -0,0 +1,49 @@ +type MarkdownSection = + | { + kind: "header"; + level: number; + content: string; + } + | { + kind: "codeBlock"; + content: string; + fileType: string; + fileName?: string; + }; + +export class Markdown { + sections: MarkdownSection[] = []; + + addHeader(level: number, content: string) { + this.sections.push({ kind: "header", level, content }); + } + + addCodeBlock(content: string, fileType: string, fileName?: string) { + this.sections.push({ kind: "codeBlock", content, fileType, fileName }); + } + + addMarkdown(markdown: Markdown) { + for (const section of markdown.sections) { + this.sections.push(section); + } + } + + toString(): string { + let output = ""; + for (const section of this.sections) { + switch (section.kind) { + case "header": + output += `${"#".repeat(section.level)} ${section.content}\n\n`; + break; + case "codeBlock": { + const fileNamePart = section.fileName + ? ` title="${section.fileName}"` + : ""; + output += `\`\`\`${section.fileType}${fileNamePart}\n${section.content.trim()}\n\`\`\`\n\n`; + break; + } + } + } + return output.trim(); + } +} diff --git a/src/tests/TestRunner.ts b/src/tests/TestRunner.ts index 6d87bc27..01bb1c86 100644 --- a/src/tests/TestRunner.ts +++ b/src/tests/TestRunner.ts @@ -3,6 +3,7 @@ import * as path from "path"; import { diff } from "jest-diff"; import { ask } from "./yesNo"; import { Result } from "../utils/Result"; +import { Markdown } from "./Markdown"; type Transformer = ( code: string, @@ -116,14 +117,15 @@ export default class TestRunner { ? transformResult.value : transformResult.err; - const testOutput = `----------------- -INPUT ------------------ -${fixtureContent} ------------------ -OUTPUT ------------------ -${actualOutput}`; + const fileType = path.extname(fixture).slice(1); + + const output = new Markdown(); + output.addHeader(2, "input"); + output.addCodeBlock(fixtureContent, fileType, fixture); + output.addHeader(2, "Output"); + output.addCodeBlock(actualOutput, ""); + + const testOutput = output.toString(); // Validate naming convention: .invalid files should have errors, others should succeed const isInvalidTest = fixture.includes(".invalid."); diff --git a/src/tests/configParserFixtures/empty.json.expected.md b/src/tests/configParserFixtures/empty.json.expected.md index cbed7d58..5812ed61 100644 --- a/src/tests/configParserFixtures/empty.json.expected.md +++ b/src/tests/configParserFixtures/empty.json.expected.md @@ -1,11 +1,12 @@ ------------------ -INPUT ------------------ +## input + +```json title="empty.json" {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Parsed Config -- { "graphqlSchema": "./schema.graphql", @@ -20,4 +21,5 @@ OUTPUT "importModuleSpecifierEnding": "", "EXPERIMENTAL__emitMetadata": false, "EXPERIMENTAL__emitResolverMap": false -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/experimentalField.json.expected.md b/src/tests/configParserFixtures/experimentalField.json.expected.md index 9c915af4..e40947c2 100644 --- a/src/tests/configParserFixtures/experimentalField.json.expected.md +++ b/src/tests/configParserFixtures/experimentalField.json.expected.md @@ -1,13 +1,14 @@ ------------------ -INPUT ------------------ +## input + +```json title="experimentalField.json" { "EXPERIMENTAL__emitMetadata": true } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Parsed Config -- { "graphqlSchema": "./schema.graphql", @@ -24,4 +25,5 @@ OUTPUT "EXPERIMENTAL__emitResolverMap": false } -- Warnings -- -Grats: The `EXPERIMENTAL__emitMetadata` option is experimental and will be renamed or removed in a future release. \ No newline at end of file +Grats: The `EXPERIMENTAL__emitMetadata` option is experimental and will be renamed or removed in a future release. +``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md b/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md index b0224d82..7234c57a 100644 --- a/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md +++ b/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md @@ -1,11 +1,13 @@ ------------------ -INPUT ------------------ +## input + +```json title="invlaidKey.invalid.json" { "lol": true } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: Unknown Grats config option `lol`. +``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/multiLineHeader.json.expected.md b/src/tests/configParserFixtures/multiLineHeader.json.expected.md index b8f64bb6..96ff7f85 100644 --- a/src/tests/configParserFixtures/multiLineHeader.json.expected.md +++ b/src/tests/configParserFixtures/multiLineHeader.json.expected.md @@ -1,13 +1,14 @@ ------------------ -INPUT ------------------ +## input + +```json title="multiLineHeader.json" { "schemaHeader": ["/**", " * An amazing GraphQL schema", " */"] } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Parsed Config -- { "graphqlSchema": "./schema.graphql", @@ -22,4 +23,5 @@ OUTPUT "importModuleSpecifierEnding": "", "EXPERIMENTAL__emitMetadata": false, "EXPERIMENTAL__emitResolverMap": false -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md b/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md index 48deb38e..872fce52 100644 --- a/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md +++ b/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md @@ -1,11 +1,13 @@ ------------------ -INPUT ------------------ +## input + +```json title="multiLineNonHeader.invalid.json" { "tsSchema": ["/path/", "to/", "schema.ts"] } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: Expected property `tsSchema` to be a string, but got ["/path/","to/","schema.ts"]. +``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md b/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md index b8aa1b8d..b6329517 100644 --- a/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md +++ b/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md @@ -1,11 +1,13 @@ ------------------ -INPUT ------------------ +## input + +```json title="nonNullableFieldIsNull.invalid.json" { "importModuleSpecifierEnding": null } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: The Grats config option `importModuleSpecifierEnding` must be a `string` if provided. +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md b/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md index b3c55f74..ddf64f9f 100644 --- a/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/ArgReferencesNonGqlType.invalid.ts" type NotGraphql = any; /** @gqlType */ @@ -10,11 +10,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts:6:35 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 6 hello({ greeting }: { greeting: NotGraphql }): string { ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md b/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md index ae844548..b4eaf3f4 100644 --- a/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/ArgWithNoType.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/ArgWithNoType.invalid.ts:4:25 - error: Expected GraphQL field argument to have an explicit type annotation. For example: `{ someField: string }`. Grats needs to be able to see the type of the arguments to generate a GraphQL schema. 4 hello({ greeting }: { greeting }): string { ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md b/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md index bd158c52..39cd4cf8 100644 --- a/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md +++ b/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/ArgumentWithDescription.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -11,10 +11,11 @@ export default class SomeType { return `${args.greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello( @@ -46,3 +47,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md index 1f92c22c..e68e1bdb 100644 --- a/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/AsyncIterableArgument.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export default class SomeType { return `${args.greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts:4:27 - error: `AsyncIterable` is not a valid as an input type. 4 hello(args: { greeting: AsyncIterable }): string { ~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md b/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md index f1bcebdd..9f57adcc 100644 --- a/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/CustomScalarArgument.ts" /** @gqlScalar */ export type MyString = string; @@ -11,10 +11,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- scalar MyString @@ -55,3 +56,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [MyStringType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md b/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md index 88aba529..1851a128 100644 --- a/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/DeprecatedArgument.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -13,10 +13,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String @deprecated(reason: "Not used anymore")): String @@ -45,3 +46,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md index e8475115..e1536f71 100644 --- a/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/DeprecatedRequiredArgument.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -13,10 +13,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts:7:10 - error: Required argument SomeType.hello(greeting:) cannot be deprecated. 7 /** @deprecated Not used anymore */ @@ -26,3 +27,4 @@ src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts:7:10 - error: 8 greeting: string; ~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md b/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md index 2999df3b..50cb7d29 100644 --- a/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md +++ b/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/GqlTypeUsedAsPositionalArg.ts" /** @gqlInput */ type Greeting = { name: string; @@ -14,10 +14,11 @@ export default class SomeType { return `${greeting.salutation} ${greeting.name}!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting { name: String! @@ -68,3 +69,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md b/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md index 21fb631e..549d8e50 100644 --- a/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts:4:37 - error: Unexpected multiple resolver parameters typed with an object literal. Grats assumes a resolver parameter typed with object literals describes the GraphQL arguments. Therefore only one such parameter is permitted. 4 hello(args: { greeting: string }, alsoArgs: { farewell: string }): string { @@ -21,3 +22,4 @@ src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts:4:37 - 4 hello(args: { greeting: string }, alsoArgs: { farewell: string }): string { ~~~~~~~~~~~~~~~~~~~~~~~~~~ Previous type literal +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md b/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md index 9b907285..5b020bf4 100644 --- a/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/NoArgsWithNever.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -9,13 +9,15 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts:4:15 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. 4 hello(args: never): string { ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md b/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md index b372a7ce..27d96a2e 100644 --- a/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/NoArgsWithUnknown.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -9,13 +9,15 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts:4:15 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. 4 hello(args: unknown): string { ~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md b/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md index b0f7947e..42896970 100644 --- a/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/NoTypeAnnotation.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts:4:9 - error: Missing type annotation for resolver argument. Expected all resolver arguments to have an explicit type annotation. Grats needs to be able to see the type of the arguments to generate an executable GraphQL schema. 4 hello(args): string { ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md index 79d385e6..b56fcd89 100644 --- a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/NullableArgumentErrors.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -21,10 +21,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:4:26 - error: Expected nullable argument to _also_ be optional (`?`). graphql-js may omit properties on the argument object where an undefined GraphQL variable is passed, or if the argument is omitted in the operation text. To ensure your resolver is capable of handling this scenario, add a `?` to the end of the argument name to make it optional. e.g. `{greeting?: string | null}` @@ -96,3 +97,4 @@ export default class SomeType { return "Hello world!"; } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/NullableArguments.ts.expected.md b/src/tests/fixtures/arguments/NullableArguments.ts.expected.md index 64cbca40..88821a5b 100644 --- a/src/tests/fixtures/arguments/NullableArguments.ts.expected.md +++ b/src/tests/fixtures/arguments/NullableArguments.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/NullableArguments.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -16,10 +16,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello1(greeting: String): String @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md index 78785529..9dbcebc2 100644 --- a/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/ObjectLiteralArgument.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts:4:35 - error: Unexpected type literal. Grats expects types in GraphQL positions to be scalar types, or reference a named GraphQL type directly. You may want to define a named GraphQL type elsewhere and reference it here. 4 hello({ greeting }: { greeting: { foo: string; bar: string } }): string { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md b/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md index f6b73905..7c92b908 100644 --- a/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/OpaqueArgType.invalid.ts" type SomeType = any; /** @gqlType */ @@ -10,11 +10,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/OpaqueArgType.invalid.ts:6:23 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 6 hello({ greeting }: SomeType): string { ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md b/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md index fdbe2165..622e60bd 100644 --- a/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/OptionalArgument.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return `${greeting ?? "Hello"} World!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String): String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md index cd7ef7a2..4dd9b9b0 100644 --- a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/OptionalNonNullableArgument.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return `${greeting ?? "Hello"} World!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts:4:33 - error: Unexpected optional argument that does not also accept `null`. Optional arguments in GraphQL may get passed an explicit `null` value by the GraphQL executor. This means optional arguments must be typed to also accept `null`. Consider adding `| null` to the end of the argument type. @@ -40,3 +41,4 @@ export default class SomeType { return `${greeting ?? "Hello"} World!`; } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md b/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md index aba02ae1..68b46516 100644 --- a/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/OptionalNonNullableArgumentWithDefault.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return `${greeting ?? "Hello"} World!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String! = "Hello"): String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md index cd2cb114..dd86d7fc 100644 --- a/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgAndArgs.invalid.ts" /** @gqlInput */ type Greeting = { name: string; @@ -14,10 +14,11 @@ export default class SomeType { return `${greeting.salutation} ${greeting.name} ${args.notGreeting}!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts:10:29 - error: Unexpected arguments object in resolver that is also using positional GraphQL arguments. Grats expects that either all GraphQL arguments will be defined in a single object, or that all GraphQL arguments will be defined using positional arguments. The two strategies may not be combined. 10 hello(greeting: Greeting, args: { notGreeting: string }): string { @@ -27,3 +28,4 @@ src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts:10:29 - error: Unex 10 hello(greeting: Greeting, args: { notGreeting: string }): string { ~~~~~~~~~~~~~~~~~~ Positional GraphQL argument defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md index b127fda2..5eca3fdd 100644 --- a/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgDeprecatedOptional.ts" /** @gqlInput */ type Greeting = { name: string; @@ -17,10 +17,11 @@ export default class SomeType { return `Hullo`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting { name: String! @@ -72,3 +73,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md index b0c058c1..18f34b6a 100644 --- a/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgDeprecatedWithDefault.ts" /** @gqlInput */ type Greeting = { name: string; @@ -17,10 +17,11 @@ export default class SomeType { return `Hullo`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting { name: String! @@ -76,3 +77,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md index 59c0b855..60b24cd1 100644 --- a/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgOptional.ts" /** @gqlInput */ type Greeting = { name: string; @@ -14,10 +14,11 @@ export default class SomeType { return `${greeting ?? "Hello"} World`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting { name: String! @@ -68,3 +69,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md index e776ccc8..53d487cc 100644 --- a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgOptionalNotNullable.invalid.ts" /** @gqlInput */ type Greeting = { name: string; @@ -14,10 +14,11 @@ export default class SomeType { return `${greeting ?? "Hello"} World`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts:10:17 - error: Unexpected optional argument that does not also accept `null`. Optional arguments in GraphQL may get passed an explicit `null` value by the GraphQL executor. This means optional arguments must be typed to also accept `null`. Consider adding `| null` to the end of the argument type. @@ -52,3 +53,4 @@ export default class SomeType { return `${greeting ?? "Hello"} World`; } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md index e1009fd7..b8427167 100644 --- a/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgWithDefault.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return `${greeting} World`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String! = "Hello"): String @@ -43,3 +44,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md index 44182b83..1536ca3e 100644 --- a/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PositionalArgWithDescription.ts" /** @gqlInput */ type Greeting = { name: string; @@ -17,10 +17,11 @@ export default class SomeType { return `${greeting.salutation} ${greeting.name}!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting { name: String! @@ -75,3 +76,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md index 6abdbff9..52365976 100644 --- a/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/PromiseArgument.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export default class SomeType { return `${args.greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/PromiseArgument.invalid.ts:4:27 - error: `Promise` is not a valid as an input type. 4 hello(args: { greeting: Promise }): string { ~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/StringArgument.ts.expected.md b/src/tests/fixtures/arguments/StringArgument.ts.expected.md index 72e3b046..0dd2c4ce 100644 --- a/src/tests/fixtures/arguments/StringArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/StringArgument.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/StringArgument.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String!): String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md index 4c330bd5..d4a01520 100644 --- a/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="arguments/TupleLiteralArgument.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,13 +8,15 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts:4:35 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. 4 hello({ greeting }: { greeting: [string] }): string { ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md b/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md index dc6e8769..3a16ddd4 100644 --- a/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="built_in_scalars/FloatField.ts" import { Float } from "../../../Types"; /** @gqlType */ @@ -10,10 +10,11 @@ export default class SomeType { return 10; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { ratio: Float @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md b/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md index de2d5463..4127bbe1 100644 --- a/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="built_in_scalars/FloatFieldAliasedImport.ts" import { Float as LocalFloat } from "../../../Types"; /** @gqlType */ @@ -10,10 +10,11 @@ export default class SomeType { return 10; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { ratio: Float @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md b/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md index 7ea3ec8c..c40a1d27 100644 --- a/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="built_in_scalars/IdField.ts" import { ID } from "../../../Types"; /** @gqlType */ @@ -10,10 +10,11 @@ export default class SomeType { return "QUERY_ID"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { id: ID @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md b/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md index aa597960..b3be8aed 100644 --- a/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="built_in_scalars/IntField.ts" import { Int } from "../../../Types"; /** @gqlType */ @@ -10,10 +10,11 @@ export default class SomeType { return 10; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { age: Int @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md b/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md index 45598440..1a68c629 100644 --- a/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/commentFollowsDecorator.invalid.ts" @ObjectType() /** @gqlType */ export default class Composer { @@ -10,10 +10,11 @@ export default class Composer { return `/composer/`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts:2:5 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 /** @gqlType */ @@ -22,3 +23,4 @@ src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts:5:7 - error: Unex 5 /** @gqlField */ ~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md index 043631e3..d10a4823 100644 --- a/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/detachedBlockComment.invalid.ts" /** * @gqlType */ /** * Foo */ +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/comments/detachedBlockComment.invalid.ts:2:4 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 * @gqlType ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md index 026ae6e3..567616ad 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts" /* @gqlType */ /** * Foo */ +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts:2:4 - error: Unexpected Grats tag in non-JSDoc-style block comment. Grats only looks for tags in JSDoc-style block comments which start with `/**`. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax @@ -37,3 +38,4 @@ src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts:2 /** * Foo */ +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md index 8bcfbf3b..91607ae1 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/detachedBlockCommentWithInvalidTagName.invalid.ts" /** * @gqlTyp */ /** * Foo */ +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts:2:4 - error: `@gqlTyp` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. 2 * @gqlTyp @@ -19,3 +20,4 @@ src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts:2: 2 * @gqlTyp ~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md index a29c02d6..a377fe02 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/detachedBlockCommentWithKillsParent.invalid.ts" /** * @killsParentOnException */ /** * Foo */ +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts:2:4 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 * @killsParentOnException ~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md index 148c5844..70fc219e 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/detachedBlockCommentWithoutStar.invalid.ts" /** @gqlType */ /** * Foo */ +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts:2:4 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 @gqlType ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md index ffa0d9c5..14608419 100644 --- a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/invalidTagInLinecomment.invalid.ts" // @gqlTyp export default class Composer { url(): string { return `/composer/`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts:1:4 - error: `@gqlTyp` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. @@ -41,3 +42,4 @@ export default class Composer { return `/composer/`; } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md index 6d82f1f6..938bd38a 100644 --- a/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/lineComment.invalid.ts" // @gqlType export default class Composer { // @gqlField @@ -8,10 +8,11 @@ export default class Composer { return `/composer/`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/comments/lineComment.invalid.ts:1:4 - error: Unexpected Grats tag in line (`//`) comment. Grats looks for tags in JSDoc-style block comments. e.g. `/** @gqlType */`. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax @@ -54,3 +55,4 @@ export default class Composer { return `/composer/`; } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md index c8911950..56096a46 100644 --- a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/lineCommentWrongCasing.invalid.ts" // @GQLtYPE export default class Composer { // @gqlfield @@ -8,10 +8,11 @@ export default class Composer { return `/composer/`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts:1:4 - error: `@GQLtYPE` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. @@ -62,3 +63,4 @@ export default class Composer { return `/composer/`; } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md index 8c525196..95fc5a35 100644 --- a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="comments/nonJSDocBlockComment.invalid.ts" // Oops! Forgot to use two asterisks for the JSDoc block comment. /* @gqlType */ class Composer {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts:3:4 - error: Unexpected Grats tag in non-JSDoc-style block comment. Grats only looks for tags in JSDoc-style block comments which start with `/**`. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax @@ -34,3 +35,4 @@ src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts:3:4 - error: Unexpec /** @gqlType */ class Composer {} +``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md b/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md index 30ab8dd1..d7bd54da 100644 --- a/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="configOptions/headerIsArrayWithNumber.invalid.ts" // {"schemaHeader": ["Hello", 1]} /** @gqlType */ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: Expected property `schemaHeader` to be a string or array of strings, but got ["Hello",1]. +``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md b/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md index 791f133a..f944a162 100644 --- a/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md +++ b/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="configOptions/importModuleSpecifierEnding.ts" // {"importModuleSpecifierEnding": ".js"} /** @gqlType */ @@ -13,10 +13,11 @@ export default class SomeType { export function greeting(t: SomeType): string { return t.hello + " world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -48,3 +49,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md b/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md index f0271a94..90a9456e 100644 --- a/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="configOptions/invalidKey.invalid.ts" // {"invalidKey": "Oops"} /** @gqlType */ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: Unknown Grats config option `invalidKey`. +``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md b/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md index 03770353..98dc813c 100644 --- a/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="configOptions/multipleInvalidKeys.invalid.ts" // {"invalidKey": "Oops", "anotherInvalidKey": "Oops"} /** @gqlType */ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: Unknown Grats config option `invalidKey`. +``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md b/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md index 2e89fb2e..e17f8a6a 100644 --- a/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="configOptions/nonNullableIsNull.invalid.ts" // {"tsSchema": null} /** @gqlType */ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` error: The Grats config option `tsSchema` must be a `string` if provided. +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md b/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md index ba866e02..46f80b1b 100644 --- a/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/DefineCustomScalar.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -9,10 +9,11 @@ class SomeType { /** @gqlScalar */ export type MyUrl = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- scalar MyUrl @@ -48,3 +49,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [MyUrlType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md b/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md index 474ca372..32795919 100644 --- a/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/DefineCustomScalarWithDescription.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -12,10 +12,11 @@ class SomeType { * @gqlScalar */ export type MyUrl = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """Use this for URLs.""" scalar MyUrl @@ -53,3 +54,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [MyUrlType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md b/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md index c378b3b6..3d06e65a 100644 --- a/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/DefineRenamedCustomScalar.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -9,10 +9,11 @@ class SomeType { /** @gqlScalar CustomName */ export type MyUrl = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- scalar CustomName @@ -48,3 +49,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [CustomNameType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md index 82a51609..f97f7215 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/SpecifiedBy.ts" /** * @gqlScalar * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122") */ export type UUID = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") -- TypeScript -- @@ -31,3 +32,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [UUIDType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md index 75a77e10..fc7d7416 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md @@ -1,18 +1,20 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts" /** * @gqlScalar * @gqlAnnotate specifiedBy */ export type UUID = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts:3:4 - error: Directive "@specifiedBy" argument "url" of type "String!" is required, but it was not provided. 3 * @gqlAnnotate specifiedBy ~~~~~~~~~~~~~~~~~~~~~~~~ 4 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md index 38fd461b..963cdfbc 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/SpecifiedByOldSyntax.invalid.ts" /** * @gqlScalar * @specifiedBy https://tools.ietf.org/html/rfc4122 */ export type UUID = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts:3:4 - error: The `@specifiedBy` tag has been deprecated in favor of `@gqlAnnotate`. Use `@gqlAnnotate specifiedBy(url: "http://example.com")` instead. @@ -38,3 +39,4 @@ src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts:3:4 - error: T * @gqlScalar * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122")*/ export type UUID = string; +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md index 8a874364..03b117c1 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md @@ -1,18 +1,20 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/SpecifiedByOnEnum.invalid.ts" /** * @gqlEnum * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122") */ export type MyEnum = "A" | "B" | "C"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts:3:4 - error: Directive "@specifiedBy" may not be used on ENUM. 3 * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md index 4a2d8c70..f1195900 100644 --- a/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md @@ -1,13 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="custom_scalars/TagAttachedToWrongNode.invalid.ts" /** @gqlScalar Matrix */ function Foo() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlScalar` can only be used on type alias declarations. e.g. `type MyScalar = string` 1 /** @gqlScalar Matrix */ ~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md index 68064910..43e9c12c 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentArray.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -15,10 +15,11 @@ export default class SomeType { return inputs.join("|"); } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { someField1(inputs: [String!] = ["hello", "there"]): String @@ -50,3 +51,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md index a0799fb5..702a7bf5 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentArrayValuesInvalid.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -19,10 +19,11 @@ export default class SomeType { function func(): string { return "sup"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts:5:15 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. @@ -35,3 +36,4 @@ If you think Grats should be able to infer this constant value, please report an 5 inputs = [func(), func()], ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md index 11d274c0..333a8d94 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentBooleanLiteral.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -15,10 +15,11 @@ export default class SomeType { return "hello"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { someField1(greet: Boolean = false): String @@ -58,3 +59,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md index 8a9192f7..963bde24 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentNullLiteral.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -14,10 +14,11 @@ export default class SomeType { return "hello"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { someField1(hello: String = null): String @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md index 30387b80..1719845b 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentNumberLiteral.ts" import { Float, Int } from "../../../Types"; /** @gqlType */ @@ -14,10 +14,11 @@ export default class SomeType { return `${scale} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { floatField(scale: Float! = 10): String @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md index f99e6834..36e77ac2 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentObjectLiteral.ts" import { Int } from "../../../Types"; /** @gqlType */ @@ -20,10 +20,11 @@ type ConnectionInput = { first: Int; offset: Int; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input ConnectionInput { first: Int! @@ -75,3 +76,4 @@ export function getSchema(): GraphQLSchema { types: [ConnectionInputType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md index aa3d96ca..c08fd5c3 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts" import { Int } from "../../../Types"; const x = "first"; @@ -22,11 +22,13 @@ type ConnectionInput = { first: Int; offset: Int; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts:9:15 - error: Expected a name identifier. Grats expected to find a name here which it could use to derive the GraphQL name. 9 input = { [x]: 10, offset: 100 }, ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md index 34b1929e..12181052 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts" import { Int } from "../../../Types"; const first = 10; @@ -22,10 +22,11 @@ type ConnectionInput = { first: Int; offset: Int; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts:9:15 - error: Expected property to be a default assignment. For example: `{ first = 10}`. Grats needs to extract a literal GraphQL value here, and that requires Grats being able to see the literal value in the source code. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. @@ -38,3 +39,4 @@ If you think Grats should be able to infer this constant value, please report an 9 input = { first, offset }, ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md index 752ea498..fcdd35ca 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts" import { Int } from "../../../Types"; /** @gqlType */ @@ -24,10 +24,11 @@ type ConnectionInput = { first: Int; offset: Int; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts:7:22 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. @@ -40,3 +41,4 @@ If you think Grats should be able to infer this constant value, please report an 7 input = { first: func(), offset: func() }, ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md index d8f35aa8..05f4845a 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentObjectLiteralSpread.invalid.ts" import { Int } from "../../../Types"; const defaultArgs = { first: 10, offset: 10 }; @@ -22,13 +22,15 @@ type ConnectionInput = { first: Int; offset: Int; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts:9:15 - error: Expected property to be a default assignment. For example: `{ first = 10}`. Grats needs to extract a literal GraphQL value here, and that requires Grats being able to see the literal value in the source code. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. 9 input = { ...defaultArgs }, ~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md index 9be72092..c4ff8757 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentPropertyName.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return x ? "hello" : "world"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(if: Boolean! = false): String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md index e40fa82c..f6d69ff2 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentStringLiteral.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return `${greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String! = "hello"): String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md index 2980e922..dc185d59 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentStringLiteralBackticks.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return `${greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello(greeting: String! = "hello"): String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md index ddc85853..8f6c5534 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts" const CONSTANT = "constant"; /** @gqlType */ @@ -10,13 +10,15 @@ export default class SomeType { return `${greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts:6:22 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. 6 hello({ greeting = `hello ${CONSTANT}` }: { greeting: string }): string { ~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md b/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md index 8218a6f5..cb9b8d3d 100644 --- a/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="default_values/NonLiteralDefaultValue.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,13 +8,15 @@ export default class SomeType { return `${greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts:4:22 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. 4 hello({ greeting = String(Math.random()) }: { greeting: string }): string { ~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md b/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md index bba94fbe..ddead835 100644 --- a/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/cyclicContextDependency.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -25,10 +25,11 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts:10:5 - error: Cyclic dependency detected in derived context. This derived context value depends upon itself. 10 /** @gqlContext */ @@ -38,3 +39,4 @@ src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts:10:5 - err 13 oops: DerivedContext, ~~~~~~~~~~~~~~~~~~~~ This derived context depends on itself +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md b/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md index 18e441f9..c9d1314e 100644 --- a/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/cyclicContextDependencyWithChain.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -40,10 +40,11 @@ type Query = unknown; export function greeting(_: Query, ctx: A): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts:10:5 - error: Cyclic dependency detected in derived context. This derived context value depends upon itself. 10 /** @gqlContext */ @@ -61,3 +62,4 @@ src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts:1 29 export function c(ctx: RootContext, a: A): C { ~~~~ Which ultimately creates a cycle back to the initial derived context +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md index bfb3c944..9abee6dd 100644 --- a/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/derivedContextChain.invalid.ts" /** @gqlContext */ type RootContext = { userName: string }; @@ -47,10 +47,11 @@ export function consumingMultipleContexts( ): string { return `${root.userName} ${a.greeting} ${b.greeting} ${everything.greeting}`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/derivedContextChain.invalid.ts:6:5 - error: Cyclic dependency detected in derived context. This derived context value depends upon itself. 6 /** @gqlContext */ @@ -85,3 +86,4 @@ src/tests/fixtures/derived_context/derivedContextChain.invalid.ts:6:5 - error: C 14 export function createDerivedContextB(ctx: DerivedContextA): DerivedContextB { ~~~~~~~~~~~~~~~~~~~~ Which ultimately creates a cycle back to the initial derived context +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md index 2de2078e..d5b61f4c 100644 --- a/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/derivedContextNoReturnType.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -22,10 +22,11 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts:11:1 - error: Expected derived resolver to have an explicit return type. This is needed to allow Grats to "see" which type to treat as a derived context type. 11 export function createDerivedContext(ctx: RootContext) { @@ -34,3 +35,4 @@ src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts:11:1 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13 } ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md index 1a068831..305b0127 100644 --- a/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/derivedContextNonNamedReturnType.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -22,11 +22,13 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts:11:57 - error: Expected derived resolver to have an explicit return type. This is needed to allow Grats to "see" which type to treat as a derived context type. 11 export function createDerivedContext(ctx: RootContext): { greeting: string } { ~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md index 2b538984..be0ab1f4 100644 --- a/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/derivedContextUsedMultipleTimes.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -27,10 +27,11 @@ export function greeting(_: Query, ctx: DerivedContext): string { export function farewell(_: Query, ctx: DerivedContext): string { return `${ctx.greeting}... NOT!`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { farewell: String @@ -66,3 +67,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md index c1295530..c07e9b81 100644 --- a/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/multipleDerivedContextsSameType.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -27,10 +27,11 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts:6:1 - error: Multiple derived contexts defined for given type 6 type DerivedContext = { @@ -48,3 +49,4 @@ src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts:6: 10 /** @gqlContext */ ~~~~~~~~~~~~ Another here +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md index 451f5f1e..dce01624 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/simpleDerivedContext.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -22,10 +22,11 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greeting: String @@ -53,3 +54,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md index 55f71108..9bbf2123 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/simpleDerivedContextNoArgs.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -22,10 +22,11 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greeting: String @@ -53,3 +54,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md index c571a491..9afa26bb 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/simpleDerivedContextReadsRandomType.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -25,11 +25,13 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts:13:3 - error: Invalid type for derived context function argument. Derived context functions may only accept other `@gqlContext` types as arguments. 13 oops: string, ~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md index 62c18bbe..ae9f76e3 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derived_context/simpleDerivedContextUndefinedType.invalid.ts" /** @gqlContext */ type RootContext = { userName: string; @@ -22,11 +22,13 @@ type Query = unknown; export function greeting(_: Query, ctx: DerivedContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts:11:57 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 11 export function createDerivedContext(ctx: RootContext): DerivedContext { ~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md b/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md index 87c2568d..1a1a7cd0 100644 --- a/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md +++ b/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="descriptions/BlankLinesAroundDescription.ts" /** * * @@ -26,10 +26,11 @@ class SomeType { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """Sup""" type SomeType { @@ -54,3 +55,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md b/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md index d6743ec7..111eecad 100644 --- a/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md +++ b/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="descriptions/BlankLinesFollowTypeTag.ts" /** * @gqlType * @@ -13,10 +13,11 @@ class SomeType { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { name: String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md b/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md index 11c04eb4..f3177815 100644 --- a/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md +++ b/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="descriptions/DescriptionFollowsTypeTag.invalid.ts" /** * @gqlType * @@ -12,10 +12,11 @@ export type Query = unknown; export function queryField(_: Query): string { return ""; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts:2:4 - error: Expected text following a `@gqlType` tag to be a GraphQL name. If you intended this text to be a description, place it at the top of the docblock before any `@tags`. 2 * @gqlType @@ -26,3 +27,4 @@ src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts:2:4 - error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md b/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md index aaba20d4..83ad2b83 100644 --- a/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md +++ b/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="descriptions/DescriptionOnLineOfTypeTag.invalid.ts" /** * @gqlType This is a note for myself */ @@ -10,13 +10,15 @@ export type Query = unknown; export function queryField(_: Query): string { return ""; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts:2:4 - error: Expected text following a `@gqlType` tag to be a GraphQL name. If you intended this text to be a description, place it at the top of the docblock before any `@tags`. 2 * @gqlType This is a note for myself ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md b/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md index f1146a2a..5e3b465b 100644 --- a/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md +++ b/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="descriptions/MultilineDescription.ts" /** * ’Twas brillig, and the slithy toves * Did gyre and gimble in the wabe: @@ -13,10 +13,11 @@ class SomeType { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """ ’Twas brillig, and the slithy toves @@ -46,3 +47,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md b/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md index e67117f6..2883ec90 100644 --- a/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md +++ b/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="descriptions/RenameFollowedByDescription.invalid.ts" /** * @gqlType User * @@ -10,10 +10,11 @@ class SomeType { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts:2:4 - error: Expected text following a `@gqlType` tag to be a GraphQL name. If you intended this text to be a description, place it at the top of the docblock before any `@tags`. 2 * @gqlType User @@ -24,3 +25,4 @@ src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts:2:4 - err ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md index 39167bbe..12e03399 100644 --- a/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirective.ts" /** * This is my custom directive. * @gqlDirective on FIELD_DEFINITION */ export function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective on FIELD_DEFINITION @@ -25,3 +26,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md index 3464763b..77a89b0a 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts" import { GraphQLFieldResolver } from "graphql"; /** @@ -13,10 +13,11 @@ export function customDirective( ) { // } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective(someArg: String!) on FIELD_DEFINITION @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md index ae3ba157..df626408 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveArgsIsNever.ts" import { GraphQLFieldResolver } from "graphql"; /** @@ -13,10 +13,11 @@ export function customDirective( ) { // } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective on FIELD_DEFINITION @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md index 0f4af4fd..e6ea5625 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveCustomName.ts" /** * This is my custom directive. * @gqlDirective aBetterName on FIELD_DEFINITION */ export function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @aBetterName on FIELD_DEFINITION @@ -25,3 +26,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md index 972de720..67ffcc6b 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md @@ -1,18 +1,20 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveLocationInvalid.invalid.ts" /** * This is my custom directive. * @gqlDirective on WHOOPS */ export function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts:3:4 - error: Syntax Error: Unexpected Name "WHOOPS". 3 * @gqlDirective on WHOOPS ~~~~~~~~~~~~~~~~~~~~~~~ 4 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md index e6d15985..827a4a4a 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveMultipleLocations.ts" /** * This is my custom directive. * @gqlDirective on FIELD_DEFINITION | ARGUMENT_DEFINITION */ function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective on FIELD_DEFINITION | ARGUMENT_DEFINITION @@ -25,3 +26,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md index 7437bde8..e326eda5 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md @@ -1,18 +1,20 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveNoLocation.invalid.ts" /** * This is my custom directive. * @gqlDirective */ function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts:3:4 - error: Expected `@gqlDirective` tag to specify at least one location. 3 * @gqlDirective ~~~~~~~~~~~~~ 4 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md index 4c05aec8..3d7f20cc 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveOnIsNotString.invalid.ts" /** * This is my custom directive. * @gqlDirective on FIELD_DEFINITION This is a description with {@link https://example.com some link} * and `inline code` to demonstrate structured comments. */ function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts:3:65 - error: Expected Grats JSDoc tag value to be simple text. 3 * @gqlDirective on FIELD_DEFINITION This is a description with {@link https://example.com some link} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md index 4083a280..1c7b3046 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveReadsContext.invalid.ts" /** @gqlContext */ type Ctx = {}; @@ -9,11 +9,13 @@ type Ctx = {}; * @gqlDirective on FIELD_DEFINITION */ export function customDirective(oops: Ctx) {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts:8:33 - error: Expected first argument of a `@gqlDirective` function to be typed using an inline object literal. 8 export function customDirective(oops: Ctx) {} ~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md index 0c8b28ac..77ffd557 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveRepeatable.ts" /** * This is my custom directive. * @gqlDirective repeatable on FIELD_DEFINITION */ function customDirective() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective repeatable on FIELD_DEFINITION @@ -26,3 +27,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md index 987efa38..7aa0bcf4 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveWithArgs.ts" /** * This is my custom directive. * @gqlDirective on FIELD_DEFINITION */ export function customDirective(arg: { someArg: string }) {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective(someArg: String!) on FIELD_DEFINITION @@ -30,3 +31,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md index 226d4ceb..bdffd51e 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveWithArgsNonScalar.ts" /** @gqlInput */ type SomeInput = { someField: string; @@ -11,10 +11,11 @@ type SomeInput = { * @gqlDirective on FIELD_DEFINITION */ export function customDirective(args: { someArg: SomeInput }) {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective(someArg: SomeInput!) on FIELD_DEFINITION @@ -50,3 +51,4 @@ export function getSchema(): GraphQLSchema { types: [SomeInputType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md index 8d969714..8bf3290c 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/defineCustomDirectiveWithArgsWithDefault.ts" /** * This is my custom directive. * @gqlDirective on FIELD_DEFINITION */ export function customDirective({ someArg = "Hello" }: { someArg: string }) {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @customDirective(someArg: String! = "Hello") on FIELD_DEFINITION @@ -31,3 +32,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md index d2c46397..3d0b563a 100644 --- a/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveArgFieldInvalid.invalid.ts" /** * @gqlInput */ @@ -18,10 +18,11 @@ export function customDirective(args: { foo: MyInput }) {} export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` GraphQL request:1:27 - error: String cannot represent a non string value: 10 1 @customDirective(foo: {a: 10}) @@ -31,3 +32,4 @@ GraphQL request:1:27 - error: String cannot represent a non string value: 10 4 type MyInput = { a: string }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Parent input type defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md index 1695ecc3..3f6bf939 100644 --- a/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveArgInvalidOneOf.invalid.ts" /** * @gqlInput */ @@ -18,10 +18,11 @@ export function customDirective(args: { foo: MyInput }) {} export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` GraphQL request:1:23 - error: OneOf Input Object "MyInput" must specify exactly one key. 1 @customDirective(foo: {a: "a", b: "b"}) @@ -31,3 +32,4 @@ GraphQL request:1:23 - error: OneOf Input Object "MyInput" must specify exactly 4 type MyInput = { a: string } | { b: string }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Input type defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md b/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md index 65553e51..cddb8c5c 100644 --- a/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md +++ b/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveArgumentNameIsStringLiteralWithDefault.ts" // https://github.com/captbaritone/grats/issues/166#issuecomment-2753130827 /** @@ -13,10 +13,11 @@ function defer({ label: string; if?: boolean | null; }): void {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- directive @defer(label: String!, if: Boolean = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT -- TypeScript -- @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md index bca41772..39ee64c1 100644 --- a/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveNotConst.invalid.ts" // Because @myDirective is followed by `(` we assume it's expected to be parsed // as a directive even though it's not defined. @@ -11,13 +11,15 @@ INPUT export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/directiveNotConst.invalid.ts:6:4 - error: Syntax Error: Unexpected variable "$foo" in constant value. 6 * @gqlAnnotate myDirective(someArg: $foo) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md b/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md index 5d4e31f9..6b6731a7 100644 --- a/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnArgumentDefinition.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -17,10 +17,11 @@ export function likes(args: { }): string { return "hello"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on ARGUMENT_DEFINITION @@ -78,3 +79,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md b/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md index ebbbd407..8cf41010 100644 --- a/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnEnum.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -13,10 +13,11 @@ export function max(args: { foo: Int }) {} * @gqlAnnotate max(foo: 10) */ type MyEnum = "A" | "B"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on ENUM @@ -63,3 +64,4 @@ export function getSchema(): GraphQLSchema { types: [MyEnumType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md b/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md index 9ae22d10..900059ec 100644 --- a/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnEnumValue.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -16,10 +16,11 @@ enum MyEnum { a = "A", b = "B", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on ENUM_VALUE @@ -66,3 +67,4 @@ export function getSchema(): GraphQLSchema { types: [MyEnumType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md b/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md index 6a6dc216..93e3473c 100644 --- a/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnFieldDefinition.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -16,10 +16,11 @@ export function max(args: { foo: Int }) {} export function likes(args: { first?: Int | null }): string { return "hello"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on FIELD_DEFINITION @@ -77,3 +78,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md b/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md index b2076498..dfa796cc 100644 --- a/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnInputFieldDefinition.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -15,10 +15,11 @@ type MyType = { /** @gqlAnnotate max(foo: 10) */ myField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on INPUT_FIELD_DEFINITION @@ -64,3 +65,4 @@ export function getSchema(): GraphQLSchema { types: [MyTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md b/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md index fcf07951..7970699e 100644 --- a/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnInputObjectType.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -15,10 +15,11 @@ export function max(args: { foo: Int }) {} type MyType = { myField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on INPUT_OBJECT @@ -64,3 +65,4 @@ export function getSchema(): GraphQLSchema { types: [MyTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md b/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md index c48a98cb..498c551b 100644 --- a/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnInterface.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -16,10 +16,11 @@ interface MyInterface { /** @gqlField */ myField: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on INTERFACE @@ -65,3 +66,4 @@ export function getSchema(): GraphQLSchema { types: [MyInterfaceType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md b/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md index 0d2570d3..b785c87f 100644 --- a/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnObjectType.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -16,10 +16,11 @@ type MyType = { /** @gqlField */ myField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on OBJECT @@ -65,3 +66,4 @@ export function getSchema(): GraphQLSchema { types: [MyTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md b/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md index 3311d2f3..0d6d50f6 100644 --- a/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnScalar.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -13,10 +13,11 @@ export function max(args: { foo: Int }) {} * @gqlAnnotate max(foo: 10) */ export type MyScalar = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on SCALAR @@ -60,3 +61,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [MyScalarType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md b/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md index ff7a62e9..e53ff592 100644 --- a/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveOnUnion.ts" import { Int } from "../../../Types"; /** * This is my custom directive. @@ -31,10 +31,11 @@ type B = { /** @gqlField */ myField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """This is my custom directive.""" directive @max(foo: Int!) on UNION @@ -103,3 +104,4 @@ export function getSchema(): GraphQLSchema { types: [MyUnionType, AType, BType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md index 74356889..6a018ffb 100644 --- a/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveUsedWithInvalidArgs.invalid.ts" /** * This is my custom directive. * @gqlDirective on FIELD_DEFINITION @@ -14,12 +14,13 @@ export function customDirective(args: { foo: string }) {} export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` GraphQL request:1:23 - error: String cannot represent a non string value: 10 1 @customDirective(foo: 10) ~~ - +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md index 5d2e7718..1001861c 100644 --- a/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/directiveWithSyntaxError.invalid.ts" // Because @myDirective is followed by `(` we assume it's expected to be parsed // as a directive even though it's not defined. @@ -11,13 +11,15 @@ INPUT export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts:6:4 - error: Syntax Error: Invalid number, expected digit but got: "-". 6 * @gqlAnnotate myDirective(someArg: --oops) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md b/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md index ca9a4325..b2a89ed9 100644 --- a/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md +++ b/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/gqlAnnotateOnNonGqlDocblock.ts" // Because @gqlAnnotate can go on argument definitions which don't have any // `@gql` tag, we can't report this as an error for now. @@ -8,10 +8,11 @@ INPUT * @gqlAnnotate max(foo: ["a", "b"]) */ export function foo() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- -- TypeScript -- @@ -21,3 +22,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md b/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md index de4c82b4..26c76f58 100644 --- a/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/undefinedDirectiveWithArgs.invalid.ts" /** * @gqlQueryField * @gqlAnnotate myDirective(someArg: "someValue") @@ -8,13 +8,15 @@ INPUT export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts:3:4 - error: Unknown directive "@myDirective". 3 * @gqlAnnotate myDirective(someArg: "someValue") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md b/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md index aa18461c..3cd3aeb4 100644 --- a/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md +++ b/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="directives/undefinedDirectiveWithoutArgs.ts" /** * @gqlQueryField * @myDirective This will be ignored and assumed to be a TypeScript tag @@ -8,10 +8,11 @@ INPUT export function myQueryField(): string { return "myQueryField"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { myQueryField: String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md b/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md index 785bdcd5..51ed11b5 100644 --- a/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md +++ b/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/DeprecatedEnumVariant.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -17,10 +17,11 @@ enum Enum { /** Invalid enum value. */ INVALID = "INVALID", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum Enum { """Invalid enum value.""" @@ -64,3 +65,4 @@ export function getSchema(): GraphQLSchema { types: [EnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/Enum.ts.expected.md b/src/tests/fixtures/enums/Enum.ts.expected.md index c3d38093..4b4633e4 100644 --- a/src/tests/fixtures/enums/Enum.ts.expected.md +++ b/src/tests/fixtures/enums/Enum.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/Enum.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -12,10 +12,11 @@ enum Enum { VALID = "VALID", INVALID = "INVALID", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum Enum { INVALID @@ -54,3 +55,4 @@ export function getSchema(): GraphQLSchema { types: [EnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md index 7542ed7d..ace0dd56 100644 --- a/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumFromUnionType.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -9,10 +9,11 @@ class SomeType { /** @gqlEnum */ type MyEnum = "VALID" | "INVALID"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum MyEnum { INVALID @@ -51,3 +52,4 @@ export function getSchema(): GraphQLSchema { types: [MyEnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md index dd7564fc..e8045daa 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumFromUnionTypeNotLiteral.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -9,13 +9,15 @@ class SomeType { /** @gqlEnum */ type MyEnum = "VALID" | number; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts:8:25 - error: Expected `@gqlEnum` enum members to be string literal types. For example: `'foo'`. Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. 8 type MyEnum = "VALID" | number; ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md index ad024694..5d35cc71 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumFromUnionTypeNotStringLiteral.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -9,13 +9,15 @@ class SomeType { /** @gqlEnum */ type MyEnum = "VALID" | 1; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts:8:25 - error: Expected `@gqlEnum` enum members to be string literal types. For example: `'foo'`. Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. 8 type MyEnum = "VALID" | 1; ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md index 1d08f1fb..ea7821ad 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumFromUnionTypeOfStringLiteral.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -9,10 +9,11 @@ class SomeType { /** @gqlEnum */ type MyEnum = "VALID"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum MyEnum { VALID @@ -47,3 +48,4 @@ export function getSchema(): GraphQLSchema { types: [MyEnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md index 3c0a9a66..3b6d9871 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumFromUnionTypeWithDescription.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -12,10 +12,11 @@ class SomeType { * @gqlEnum */ type MyEnum = "VALID" | "INVALID"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """Hello!""" enum MyEnum { @@ -56,3 +57,4 @@ export function getSchema(): GraphQLSchema { types: [MyEnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md index aceac09b..45006149 100644 --- a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts" // {"tsClientEnums": "enums.ts"} /** @gqlEnum */ @@ -17,10 +17,11 @@ type Query = unknown; export function favoriteColor(_: Query): Color { return Color.RED; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts:4:1 - error: Expected enum to be exported when `tsClientEnums` is configured. Grats needs to import enum types to build the enums module. @@ -65,3 +66,4 @@ type Query = unknown; export function favoriteColor(_: Query): Color { return Color.RED; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md index 759f7f55..4c9e1430 100644 --- a/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumNotValidIdentifier.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -12,11 +12,13 @@ export enum Enum { VALID = "VALID", INVALID = "NOT AT ALL VALID", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts:10:13 - error: Names must only contain [_a-zA-Z0-9] but "NOT AT ALL VALID" does not. 10 INVALID = "NOT AT ALL VALID", ~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md b/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md index 84adb34b..81de4600 100644 --- a/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md +++ b/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumValuesDifferentThanNames.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -12,10 +12,11 @@ enum Enum { ABC = "VALID", DEF = "INVALID", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum Enum { INVALID @@ -54,3 +55,4 @@ export function getSchema(): GraphQLSchema { types: [EnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md b/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md index 9df6f389..bab5da33 100644 --- a/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md +++ b/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumWithDescription.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -16,10 +16,11 @@ enum Enum { VALID = "VALID", INVALID = "INVALID", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """World's best enum.""" enum Enum { @@ -60,3 +61,4 @@ export function getSchema(): GraphQLSchema { types: [EnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md b/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md index 644eee6d..1b5c2dad 100644 --- a/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md +++ b/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/EnumWithVariantWithDescription.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -14,10 +14,11 @@ enum Enum { /** Invalid enum value. */ INVALID = "INVALID", } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum Enum { """Invalid enum value.""" @@ -60,3 +61,4 @@ export function getSchema(): GraphQLSchema { types: [EnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md b/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md index 2baf9083..00caa22b 100644 --- a/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/ExplicitlyNumericEnum.invalid.ts" /** @gqlEnum */ enum Enum { VALID = 1, INVALID = 2, } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts:3:3 - error: Expected `@gqlEnum` enum members to have string literal initializers. For example: `FOO = 'foo'`. In GraphQL enum values are strings, and Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this enum value, please report an issue at https://github.com/captbaritone/grats/issues. @@ -22,3 +23,4 @@ If you think Grats should be able to infer this enum value, please report an iss 4 INVALID = 2, ~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md b/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md index 9bd9da35..2a48230a 100644 --- a/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts" // {"tsClientEnums": "enums.ts"} /** @gqlEnum */ @@ -25,11 +25,13 @@ export function favoriteColor(_: Query): Color { export function status(_: Query): Status { return "PENDING"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts:11:1 - error: Type alias enums are not supported when `tsClientEnums` is configured. Use `enum` declarations instead. For example: `export enum Status { PENDING = "pending" }`. 11 export type Status = "PENDING" | "COMPLETE" | "CANCELLED"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md b/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md index 00620450..c4866456 100644 --- a/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/ImplicitlyNumericEnum.invalid.ts" /** @gqlEnum */ enum Enum { VALID, INVALID, } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts:3:3 - error: Expected `@gqlEnum` enum members to have string literal initializers. For example: `FOO = 'foo'`. In GraphQL enum values are strings, and Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this enum value, please report an issue at https://github.com/captbaritone/grats/issues. @@ -22,3 +23,4 @@ If you think Grats should be able to infer this enum value, please report an iss 4 INVALID, ~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md b/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md index 95c86f6e..fb1e8879 100644 --- a/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/NonNullEnumDefault.ts" // https://github.com/captbaritone/grats/issues/174 /** @gqlEnum */ @@ -10,10 +10,11 @@ type GreetingOptions = "Hello" | "Greetings" | "Sup"; export function hello(greeting: GreetingOptions = "Greetings"): string { return `${greeting} World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum GreetingOptions { Greetings @@ -67,3 +68,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingOptionsType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md b/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md index 6b6fc188..5de29e83 100644 --- a/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/NonNullEnumDefaultInInputObject.ts" // https://github.com/captbaritone/grats/issues/174 /** @gqlEnum */ @@ -17,10 +17,11 @@ export function hello( ): string { return `${input.greeting} World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum GreetingOptions { Greetings @@ -91,3 +92,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingOptionsType, GreetingInputType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md b/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md index ece8985e..a87ebabb 100644 --- a/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/NonNullPluralEnumDefaults.ts" // https://github.com/captbaritone/grats/issues/174 /** @gqlEnum */ @@ -12,10 +12,11 @@ export function hello( ): string { return `${greeting.join(", ")} World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum GreetingOptions { Greetings @@ -72,3 +73,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingOptionsType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md b/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md index cb33380c..f8d3b1a9 100644 --- a/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/NonNullTsEnumDefault.ts" // https://github.com/captbaritone/grats/issues/174 /** @gqlEnum */ @@ -17,10 +17,11 @@ export function hello( ): string { return `${greeting} World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum GreetingOptions { GREETING @@ -74,3 +75,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingOptionsType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md b/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md index be34463a..bee5f9b4 100644 --- a/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/NonNullTsEnumDefaultStringLiteral.ts" // https://github.com/captbaritone/grats/issues/174 /** @gqlEnum */ @@ -17,10 +17,11 @@ export function hello( ): string { return `${greeting} World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum GreetingOptions { GREETING @@ -74,3 +75,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingOptionsType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md b/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md index 00eb158f..fecd05fd 100644 --- a/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts" // {"tsClientEnums": "enums.ts"} /** @gqlEnum */ @@ -13,11 +13,13 @@ type Query = unknown; export function status(_: Query): Status { return "PENDING"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts:4:1 - error: Type alias enums are not supported when `tsClientEnums` is configured. Use `enum` declarations instead. For example: `export enum Status { PENDING = "pending" }`. 4 export type Status = "PENDING" | "COMPLETE" | "CANCELLED"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/examples/playground.ts.expected.md b/src/tests/fixtures/examples/playground.ts.expected.md index b5601591..6f59e7e9 100644 --- a/src/tests/fixtures/examples/playground.ts.expected.md +++ b/src/tests/fixtures/examples/playground.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="examples/playground.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -34,10 +34,11 @@ class UserResolver { export function getUser(_: SomeType): UserResolver { return new UserResolver(); } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { getUser: User @@ -102,3 +103,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/examples/readme.ts.expected.md b/src/tests/fixtures/examples/readme.ts.expected.md index 1d93f1fd..0ce79bad 100644 --- a/src/tests/fixtures/examples/readme.ts.expected.md +++ b/src/tests/fixtures/examples/readme.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="examples/readme.ts" /** @gqlType */ type Query = unknown; @@ -29,10 +29,11 @@ class UserResolver { return `${args.salutation}, ${this.name}`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { me: User @@ -96,3 +97,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md index c88a89de..85afb39b 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/addStringFieldToEnum.invalid.ts" /** @gqlEnum */ type MyEnum = "Foo" | "Bar"; @@ -8,10 +8,11 @@ type MyEnum = "Foo" | "Bar"; export function greeting(myEnum: MyEnum): string { return `Hello ${myEnum}!`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts:5:34 - error: Unexpected type passed to `@gqlField` function. `@gqlField` functions can only be used to extend `@gqlType` and `@gqlInterface` types. 5 export function greeting(myEnum: MyEnum): string { @@ -21,3 +22,4 @@ src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts:5:34 - error 2 type MyEnum = "Foo" | "Bar"; ~~~~~~ This is the type that was passed to `@gqlField`. +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md index b0c5f020..afaa7ae6 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/addStringFieldToInterface.ts" /** @gqlInterface */ interface IPerson { name: string; @@ -28,10 +28,11 @@ class Admin implements IPerson { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson { greeting: String @@ -112,3 +113,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, AdminType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md index 7f1bf7f5..ecb4e96d 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/addStringFieldToInterfaceImplementedByInterface.ts" /** @gqlField */ export function greeting(thing: IThing): string { return `Hello ${thing.name}!`; @@ -33,10 +33,11 @@ class Admin implements IPerson, IThing { name: string; // Should have greeting added } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson implements IThing { greeting: String @@ -120,3 +121,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, IThingType, AdminType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md index 3b898e1a..e9ac3886 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/addStringFieldToInterfaceTwice.invalid.ts" /** @gqlInterface */ interface IPerson { name: string; @@ -33,10 +33,11 @@ class Admin implements IPerson { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts:9:17 - error: Field "IPerson.greeting" can only be defined once. 9 export function greeting(person: IPerson): string { @@ -64,3 +65,4 @@ src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts:9: 13 /** @gqlField greeting */ ~~~~~~~~~~~~~~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md index 070f7877..516fb4ac 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/addStringFieldToNonGrats.invalid.ts" type SomeNonGratsType = string; /** @gqlField */ export function greeting(someType: SomeNonGratsType): string { return `Hello ${someType}!`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts:4:36 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 export function greeting(someType: SomeNonGratsType): string { ~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md index ec598487..74660af6 100644 --- a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts" /** @gqlInterface */ interface IPerson { name: string; @@ -25,10 +25,11 @@ class User implements IPerson { return `Hello ${this.name}!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts:21:3 - error: Field "User.greeting" can only be defined once. 21 greeting(): string { @@ -38,3 +39,4 @@ src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invali 9 export function greeting(person: IPerson): string { ~~~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md index 21db8a89..e386d070 100644 --- a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts" /** @gqlInterface */ interface IPerson { name: string; @@ -23,10 +23,11 @@ interface User extends IPerson { /** @gqlField */ greeting(): string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts:21:3 - error: Field "User.greeting" can only be defined once. 21 greeting(): string; @@ -36,3 +37,4 @@ src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterfa 9 export function greeting(person: IPerson): string { ~~~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md b/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md index ff18709b..55041b3f 100644 --- a/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md +++ b/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/addDeprecatedField.ts" /** @gqlType */ class SomeType { // No fields @@ -13,10 +13,11 @@ class SomeType { export function greeting(query: SomeType): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @deprecated(reason: "Because reasons") @@ -44,3 +45,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md b/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md index e08f3861..64304ed5 100644 --- a/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md +++ b/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/addFieldWithArguments.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export function greeting(_: SomeType, args: { name: string }): string { return `Hello ${args.name}!`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting(name: String!): String @@ -45,3 +46,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md b/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md index e71cffcb..d4c486f1 100644 --- a/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/addFieldWithDescription.ts" /** @gqlType */ class SomeType { // No fields @@ -13,10 +13,11 @@ class SomeType { export function greeting(_: SomeType): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { """Best field ever!""" @@ -45,3 +46,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md b/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md index a6ccb371..80430be8 100644 --- a/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md +++ b/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/addRenamedFieldToSomeType.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export function greeting(_: SomeType): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md b/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md index 7316efeb..ecae577c 100644 --- a/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md +++ b/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/addStringFieldToSomeType.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export function greeting(_: SomeType): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/defaultExport.ts.expected.md b/src/tests/fixtures/extend_type/defaultExport.ts.expected.md index f9b8f1f1..f79703db 100644 --- a/src/tests/fixtures/extend_type/defaultExport.ts.expected.md +++ b/src/tests/fixtures/extend_type/defaultExport.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/defaultExport.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export default function greeting(_: SomeType): string { return `Hello World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md index bb150250..a63ae3ac 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsArrowFunctionLet.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export let greeting = (_: SomeType): string => { return `Hello World`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts:7:8 - error: Expected `@gqlField` arrow function to be declared as `const`. 7 export let greeting = (_: SomeType): string => { @@ -22,3 +23,4 @@ src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts:7:8 - error: E ~~~~~~~~~~~~~~~~~~~~~~~ 9 }; ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md index 8bc05a4c..537e1708 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsArrowFunctionNotExported.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { const greeting = (_: SomeType): string => { return `Hello World`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts:7:7 - error: Expected `@gqlField` to be an exported top-level declaration. Grats needs to import resolver functions into its generated schema module, so the resolver function must be exported from the module. @@ -44,3 +45,4 @@ class SomeType { export const greeting = (_: SomeType): string => { return `Hello World`; }; +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md index 5b9983d1..2d6a8ba0 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsArrowFunctionVar.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { var greeting = (_: SomeType): string => { return `Hello World`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts:7:1 - error: Expected `@gqlField` arrow function to be declared as `const`. 7 var greeting = (_: SomeType): string => { @@ -22,3 +23,4 @@ src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts:7:1 - error: E ~~~~~~~~~~~~~~~~~~~~~~~ 9 }; ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md index c1a4b130..ed784494 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsExportedArrowFunction.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export const greeting = (_: SomeType): string => { return `Hello World`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md index 747d9ba7..94f6062c 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export const greeting = (_: SomeType, name: string): string => { return `Hello ${name}`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting(name: String!): String @@ -45,3 +46,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md index cb036e89..1703ef74 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsExportedAsyncArrowFunction.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { export const greeting = async (_: SomeType): Promise => { return `Hello World`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md index 0d710db9..7d63b041 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsExportedMultipleVariables.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -13,10 +13,11 @@ export const greeting = (_: SomeType): string => { anotherGreeting = (_: SomeType): string => { return `Hello World`; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts:7:1 - error: Expected only one declaration when defining a `@gqlField`, found 2. 7 export const greeting = (_: SomeType): string => { @@ -28,3 +29,4 @@ src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts:7:1 - ~~~~~~~~~~~~~~~~~~~~~~~~~ 12 }; ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md index 2090f506..9cdb891b 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsExportedNothing.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -8,11 +8,13 @@ class SomeType { /** @gqlField */ export const greeting; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts:7:1 - error: Expected `@gqlField` on variable declaration to be attached to an arrow function. 7 export const greeting; ~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md index 642186c6..8eb243b2 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/fieldAsExportedNumber.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -8,11 +8,13 @@ class SomeType { /** @gqlField */ export const greeting = 10; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts:7:1 - error: Expected `@gqlField` on variable declaration to be attached to an arrow function. 7 export const greeting = 10; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md b/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md index 90342751..41df6197 100644 --- a/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md +++ b/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/functionFieldOnTypeDefinedWithInterface.ts" // https://twitter.com/edvinwennerdahl/status/1748436186840904103 /** @gqlType */ @@ -10,10 +10,11 @@ interface Cat {} export function catSound(obj: Cat): string { return "meow"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Cat { catSound: String @@ -40,3 +41,4 @@ export function getSchema(): GraphQLSchema { types: [CatType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md b/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md index 859324eb..5f8cc0c7 100644 --- a/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md +++ b/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/interfaceFirstArgumentType.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -17,10 +17,11 @@ interface IFoo { export function greeting(iFoo: IFoo): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IFoo { bar: String @@ -63,3 +64,4 @@ export function getSchema(): GraphQLSchema { types: [IFooType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md b/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md index 5651ba8f..92e577b6 100644 --- a/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/missingFirstArgument.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -10,11 +10,13 @@ class SomeType { export function greeting(/* Without an arg we can't infer the type! */): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts:7:17 - error: Expected `@gqlField` function to have a first argument representing the type to extend. If you don't need access to the parent object in the function, you can name the variable `_` to indicate that it is unused. e.g. `function myField(_: ParentType) {}` 7 export function greeting(/* Without an arg we can't infer the type! */): string { ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md b/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md index 23702991..95d5bfcf 100644 --- a/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/missingFirstArgumentType.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -12,11 +12,13 @@ export function greeting( ): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts:8:3 - error: Expected first argument of a `@gqlField` function to have an explicit type annotation. Grats treats the first argument as the parent object of the field. Therefore Grats needs to see the _type_ of the first argument in order to know to which type/interface this field should be added. 8 query /* Without an arg type we can't infer the GraphQL type to extend! */, ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md b/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md index e21ea41b..f2140a38 100644 --- a/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/nonAliasFirstArgumentType.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -10,11 +10,13 @@ class SomeType { export function greeting(query: { name: string }): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts:7:33 - error: Expected first argument of a `@gqlField` function to be typed as a type reference. Grats treats the first argument as the parent object of the field. Therefore Grats needs to see the _type_ of the first argument in order to know to which type/interface this field should be added. 7 export function greeting(query: { name: string }): string { ~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md b/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md index a9e8abeb..8cc98ef0 100644 --- a/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/nonGQLFirstArgumentType.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -12,11 +12,13 @@ class Foo {} export function greeting(query: Foo): string { return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts:9:33 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 9 export function greeting(query: Foo): string { ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md index 70742b25..9908f7fd 100644 --- a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/notExported.invalid.ts" /** @gqlType */ class SomeType { // No fields @@ -10,10 +10,11 @@ class SomeType { function greeting(_: Query): string { return `Hello World`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/extend_type/notExported.invalid.ts:7:10 - error: Expected a `@gqlField` function to be a named export. Grats needs to import resolver functions into its generated schema module, so the resolver function must be a named export. @@ -44,3 +45,4 @@ class SomeType { export function greeting(_: Query): string { return `Hello World`; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md b/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md index 5afd85ff..587503e1 100644 --- a/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md +++ b/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="extend_type/optionalModelType.ts" /** @gqlType */ class SomeType { // No fields @@ -17,10 +17,11 @@ export function greeting( } return "Hello world!"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -47,3 +48,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md b/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md index 71c4c7bc..14f6ac3a 100644 --- a/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/DeprecatedMethodField.ts" /** @gqlType */ export default class SomeType { /** @@ -11,10 +11,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @deprecated(reason: "Use something else.") @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md b/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md index 944c38f4..c8d2240f 100644 --- a/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/DeprecatedPropertyField.ts" /** @gqlType */ export default class SomeType { /** @@ -9,10 +9,11 @@ export default class SomeType { */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @deprecated(reason: "Use something else.") @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md index c5343809..b01cf399 100644 --- a/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsSetter.invalid.ts" /** @gqlType */ export class User { /** @gqlField */ @@ -8,10 +8,11 @@ export class User { // } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts:4:3 - error: `@gqlField` can only be used on method/property declarations, signatures, function or static method declarations. If you think Grats should be able to infer this field, please report an issue at https://github.com/captbaritone/grats/issues. @@ -22,3 +23,4 @@ If you think Grats should be able to infer this field, please report an issue at ~~~~~~ 6 } ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md index 8899d648..4e40b11c 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethod.ts" /** @gqlType */ export class User { /** @gqlField */ @@ -14,10 +14,11 @@ export class User { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { getUser: User @@ -60,3 +61,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md index 1d2c99f3..813b7043 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts" function main() { /** @gqlType */ class User { @@ -16,10 +16,11 @@ function main() { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts:3:9 - error: Expected class with a static `@gqlField` method to be a top-level declaration. Grats needs to import resolver methods into its generated schema module, so the resolver's class must be an exported. 3 class User { @@ -29,3 +30,4 @@ src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.inval 7 /** @gqlField */ ~~~~~~~~~~ Field defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md index 3e6bdf34..9c4cd69e 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts" function main() { /** @gqlType */ export class User { @@ -16,10 +16,11 @@ function main() { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts:3:16 - error: Expected class with a static `@gqlField` method to be a top-level declaration. Grats needs to import resolver methods into its generated schema module, so the resolver's class must be an exported. 3 export class User { @@ -29,3 +30,4 @@ src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExp 7 /** @gqlField */ ~~~~~~~~~~ Field defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md index 90950677..1d868e86 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts" /** @gqlType */ class User { /** @gqlField */ @@ -14,10 +14,11 @@ class User { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts:2:7 - error: Expected `@gqlField` static method's class to be exported. Grats needs to import resolvers into its generated schema module, so the resolver class must be an exported. @@ -56,3 +57,4 @@ export class User { /** @gqlType */ type Query = unknown; +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md index 34426b2b..848fda10 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts" export class SomeClass { /** @gqlField */ static greet(_: Query): string { @@ -10,10 +10,11 @@ export class SomeClass { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greet: String @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md index 2017754c..3d506108 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts" export default class { /** @gqlField */ static greet(_: Query): string { @@ -10,10 +10,11 @@ export default class { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greet: String @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md index 16364980..403f47d3 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts" /** @gqlType */ export default class User { /** @gqlField */ @@ -14,10 +14,11 @@ export default class User { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { getUser: User @@ -60,3 +61,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md index 853bcf85..1b03c3c2 100644 --- a/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldDefinedOnNonGqlType.invalid.ts" class Foo { /** @gqlField */ field: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts:2:8 - error: Unexpected `@gqlField`. The parent construct must be either a `@gqlType` or `@gqlInterface` tag. Are you missing one of these tags? 2 /** @gqlField */ ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md index bfea2dc1..158c58a7 100644 --- a/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md @@ -1,19 +1,21 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldOnArbitraryParam.invalid.ts" class Foo { someMethod( /** @gqlField */ foo: string, ): void {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts:4:5 - error: `@gqlField` can only be used on method/property declarations, signatures, function or static method declarations. If you think Grats should be able to infer this field, please report an issue at https://github.com/captbaritone/grats/issues. 4 foo: string, ~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md index 54cf688a..d4473d71 100644 --- a/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FieldTagOnIncorrectNode.invalid.ts" class SomeType { /** @gqlField */ constructor() { // } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts:3:3 - error: `@gqlField` can only be used on method/property declarations, signatures, function or static method declarations. If you think Grats should be able to infer this field, please report an issue at https://github.com/captbaritone/grats/issues. @@ -21,3 +22,4 @@ If you think Grats should be able to infer this field, please report an issue at ~~~~~~ 5 } ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md index 5d0ff12c..042d3c7b 100644 --- a/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts:4:12 - error: Expected exactly one non-nullish type. GraphQL does not support fields returning an arbitrary union of types. Consider defining an explicit `@gqlUnion` union type and returning that. 4 hello(): string | boolean { @@ -21,3 +22,4 @@ src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts:4: 4 hello(): string | boolean { ~~~~~~~ Other non-nullish type +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md b/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md index d7377ce5..f5844e74 100644 --- a/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/GetAcessorField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md index 9b3d6070..cad15a47 100644 --- a/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/MethodFieldMissingType.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts:4:3 - error: Expected GraphQL field methods to have an explicitly defined return type. Grats needs to be able to see the type of the field to generate its type in the GraphQL schema. 4 someMethodField() { ~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md b/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md index 2137e0aa..06ff42b2 100644 --- a/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md +++ b/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/MethodSignatureOnInterface.ts" /** @gqlInterface */ interface ICarly { /** @gqlField */ name(): string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface ICarly { name: String @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [ICarlyType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md b/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md index c31e50c7..88c43c90 100644 --- a/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md +++ b/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/MultipleFieldsAsStaticClassMethods.ts" /** @gqlType */ export class User { /** @gqlField */ @@ -19,10 +19,11 @@ export class User { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { getUser: User @@ -73,3 +74,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md index 13ddc8d2..7728a6ef 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyField.ts" /** @gqlType */ export default class SomeType { constructor( @@ -8,10 +8,11 @@ export default class SomeType { public hello: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md index abefc439..53de84b5 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts" /** @gqlType */ export default class SomeType { constructor( @@ -8,11 +8,13 @@ export default class SomeType { public [foo]: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts:5:12 - error: Expected a name identifier. Grats expected to find a name here which it could use to derive the GraphQL name. 5 public [foo]: string, ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md index 3ef64623..feb28f97 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldDeprecated.ts" /** @gqlType */ export default class SomeType { constructor( @@ -11,10 +11,11 @@ export default class SomeType { public hello: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @deprecated(reason: "Don't use this") @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md index 1e82397a..26fc3336 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldNoModifier.invalid.ts" /** @gqlType */ export default class SomeType { constructor( @@ -10,10 +10,11 @@ export default class SomeType { console.log(hello); } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts:5:5 - error: Expected `@gqlField` constructor parameter to be a parameter property. This requires a modifier such as `public` or `readonly` before the parameter name. @@ -46,3 +47,4 @@ export default class SomeType { console.log(hello); } } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md index d12bbfa0..094f9ec1 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldNoType.invalid.ts" /** @gqlType */ export default class SomeType { constructor( @@ -8,11 +8,13 @@ export default class SomeType { public hello, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts:5:5 - error: Expected `@gqlField` parameter property to have an explicit type annotation. Grats needs to be able to see the type of the parameter property to generate a GraphQL schema. 5 public hello, ~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md index 8ad67d2a..dc3acb24 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldReadOnly.ts" /** @gqlType */ export default class SomeType { constructor( @@ -8,10 +8,11 @@ export default class SomeType { readonly hello: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md index abbaa059..5cd4ddd2 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts" /** @gqlType */ export default class SomeType { constructor( @@ -11,10 +11,11 @@ export default class SomeType { private readonly hello: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts:8:5 - error: Expected `@gqlField` parameter property to be public. Valid modifiers for `@gqlField` parameter properties are `public` and `readonly`. @@ -48,3 +49,4 @@ export default class SomeType { public readonly hello: string, ) {} } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md index 4d7af756..dccdc58d 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldRenamed.ts" /** @gqlType */ export default class SomeType { constructor( @@ -8,10 +8,11 @@ export default class SomeType { public foo: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md index af7c8620..342a8c95 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ParameterPropertyFieldWithDescription.ts" /** @gqlType */ export default class SomeType { constructor( @@ -11,10 +11,11 @@ export default class SomeType { public hello: string, ) {} } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { """Greet the world!""" @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md index 6ef5bfb8..05b5c64a 100644 --- a/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/PrivateAndProtectedFieldMethods.invalid.ts" /** @gqlType */ export class User { /** @gqlField */ @@ -12,10 +12,11 @@ export class User { return "Hello"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts:4:3 - error: Unexpected access modifier on `@gqlField` method. GraphQL fields must be able to be called by the GraphQL executor. 4 private greet(): string { @@ -24,3 +25,4 @@ src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts: 8 protected greet2(): string { ~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md index b227f3ab..018cc5f2 100644 --- a/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/PropertyFieldMissingType.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ someProp; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts:4:3 - error: Expected GraphQL field to have an explicitly defined type annotation. Grats needs to be able to see the type of the field to generate a field's type in the GraphQL schema. 4 someProp; ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md b/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md index a1bc6d96..b6fa3b73 100644 --- a/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md +++ b/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/PublicFieldMethod.ts" /** @gqlType */ export class User { /** @gqlField */ @@ -8,10 +8,11 @@ export class User { return "Hello"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type User { greet: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md index 1fd7ce38..98b351bc 100644 --- a/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ReferenceNonGraphQLType.invalid.ts" type SomeUndefienedType = string; /** @gqlType */ @@ -8,11 +8,13 @@ class SomeType { /** @gqlField */ somePropertyField: SomeUndefienedType; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts:6:22 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 6 somePropertyField: SomeUndefienedType; ~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md index fcc320f0..b839afc9 100644 --- a/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/ReferenceUndefinedType.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ somePropertyField: SomeUndefienedType; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts:4:22 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 somePropertyField: SomeUndefienedType; ~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md b/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md index 14986629..4c8480af 100644 --- a/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/RenamedField.ts" /** @gqlType */ class SomeType { /** @gqlField greeting */ @@ -11,10 +11,11 @@ class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -48,3 +49,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md b/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md index 9657cca3..d4bcb18f 100644 --- a/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md +++ b/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/RenamedFieldWithArgs.ts" /** @gqlType */ export default class SomeType { /** @gqlField greetz */ @@ -8,10 +8,11 @@ export default class SomeType { return `${args.greeting} world!`; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greetz(greeting: String!): String @@ -42,3 +43,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md b/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md index 8f92f183..bffa7559 100644 --- a/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/RenamedFieldWithDescription.ts" /** @gqlType */ class SomeType { /** @@ -19,10 +19,11 @@ class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { """Number 1 greeting.""" @@ -60,3 +61,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md b/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md index 956c1052..7325e7ed 100644 --- a/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/StringFieldWithDescription.ts" /** @gqlType */ export default class SomeType { /** @@ -11,10 +11,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { """Greet the world!""" @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md index c51da05d..9f9af31c 100644 --- a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_definitions/asyncFunctionFieldNotExported.invalid.ts" /** @gqlField */ async function greet(_: Query): Promise { return "Hello, World!"; @@ -8,10 +8,11 @@ async function greet(_: Query): Promise { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts:2:16 - error: Expected a `@gqlField` function to be a named export. Grats needs to import resolver functions into its generated schema module, so the resolver function must be a named export. @@ -40,3 +41,4 @@ export async function greet(_: Query): Promise { /** @gqlType */ type Query = unknown; +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/ArrayField.ts.expected.md b/src/tests/fixtures/field_values/ArrayField.ts.expected.md index 3ba4d47d..2dde85cb 100644 --- a/src/tests/fixtures/field_values/ArrayField.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/ArrayField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return ["Hello world!"]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: [String!] @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md b/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md index b930798b..265f2a83 100644 --- a/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/ArrayOfPromises.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { /** @gqlField */ c: Array>; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { b: [String!] @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md b/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md index 6b611ee5..43905a22 100644 --- a/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/ArrayShorthandField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return ["Hello world!"]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: [String!] @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md b/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md index 015a63d5..53e35289 100644 --- a/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/ArrayWithNullableItems.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return ["Hello world!", null]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: [String] @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md b/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md index e20460f1..1af1392f 100644 --- a/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md +++ b/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/AsyncPromiseField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/BooleanField.ts.expected.md b/src/tests/fixtures/field_values/BooleanField.ts.expected.md index 95d13592..d8042e0e 100644 --- a/src/tests/fixtures/field_values/BooleanField.ts.expected.md +++ b/src/tests/fixtures/field_values/BooleanField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/BooleanField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return false; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { haveBeenGreeted: Boolean @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/CustomScalar.ts.expected.md b/src/tests/fixtures/field_values/CustomScalar.ts.expected.md index b64b8459..f19c813d 100644 --- a/src/tests/fixtures/field_values/CustomScalar.ts.expected.md +++ b/src/tests/fixtures/field_values/CustomScalar.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/CustomScalar.ts" /** @gqlScalar */ export type MyString = string; @@ -11,10 +11,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- scalar MyString @@ -50,3 +51,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [MyStringType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md b/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md index 9c0db34b..3110f446 100644 --- a/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/DuplicateFields.invalid.ts" // @ts-nocheck /** @gqlType */ @@ -14,10 +14,11 @@ export default class SomeType { return ["Hello world!"]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_values/DuplicateFields.invalid.ts:6:3 - error: Field "SomeType.hello" can only be defined once. 6 hello(): string { @@ -27,3 +28,4 @@ src/tests/fixtures/field_values/DuplicateFields.invalid.ts:6:3 - error: Field "S 10 hello(): Array { ~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md b/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md index 617b862e..19ab362d 100644 --- a/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts" /** @gqlInterface */ interface IPerson { /** @@ -22,10 +22,11 @@ export class User implements IPerson { return "Alice"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts:4:7 - error: Interface field IPerson.name expects type String! but User.name is type String. 4 * @killsParentOnException @@ -35,3 +36,4 @@ src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.inva 15 name(): string | null { ~~~~~~~~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/KitchenSink.ts.expected.md b/src/tests/fixtures/field_values/KitchenSink.ts.expected.md index b20d679e..2562d2f9 100644 --- a/src/tests/fixtures/field_values/KitchenSink.ts.expected.md +++ b/src/tests/fixtures/field_values/KitchenSink.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/KitchenSink.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -57,10 +57,11 @@ class Group { return [new User()]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Group { description: String @@ -168,3 +169,4 @@ export function getSchema(): GraphQLSchema { types: [GroupType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/LinkedField.ts.expected.md b/src/tests/fixtures/field_values/LinkedField.ts.expected.md index d9b4da56..e1f67311 100644 --- a/src/tests/fixtures/field_values/LinkedField.ts.expected.md +++ b/src/tests/fixtures/field_values/LinkedField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/LinkedField.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -20,10 +20,11 @@ class User { return [new User()]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { me: User @@ -66,3 +67,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md b/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md index 45c9e351..5538735a 100644 --- a/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md +++ b/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/LinkedFieldWithTypeArg.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -22,10 +22,11 @@ class User { other: T; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { me: User @@ -68,3 +69,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/MaybePromise.ts.expected.md b/src/tests/fixtures/field_values/MaybePromise.ts.expected.md index 4e01479f..b4d0ab77 100644 --- a/src/tests/fixtures/field_values/MaybePromise.ts.expected.md +++ b/src/tests/fixtures/field_values/MaybePromise.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/MaybePromise.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ b: Promise | null; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { b: String @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/OptionalFields.ts.expected.md b/src/tests/fixtures/field_values/OptionalFields.ts.expected.md index c1439640..81fd7915 100644 --- a/src/tests/fixtures/field_values/OptionalFields.ts.expected.md +++ b/src/tests/fixtures/field_values/OptionalFields.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/OptionalFields.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -20,10 +20,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { adieu: String @@ -61,3 +62,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md b/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md index 1ec2c7dd..b2bcd536 100644 --- a/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md +++ b/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/OptionalProperty.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ hello?: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md b/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md index 2c2bcf8e..3171bfbc 100644 --- a/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/OptionalStringFieldKillsParentOnException.invalid.ts" /** @gqlType */ export default class SomeType { /** @@ -11,11 +11,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts:5:7 - error: Unexpected `@killsParentOnException` tag on field typed as nullable. `@killsParentOnException` will force a field to appear as non-nullable in the schema, so its implementation must also be non-nullable. . 5 * @killsParentOnException ~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md b/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md index acf67fac..4e6598fc 100644 --- a/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md +++ b/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/ParenthesizedType.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return ["Hello world!"]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: [String] @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md b/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md index e84ff807..e3bfea65 100644 --- a/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md +++ b/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/PromiseOfPromise.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ b: Promise>; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { b: String @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md b/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md index f07eadc5..8216adaf 100644 --- a/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md +++ b/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/ReadonlyArrayField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return ["Hello world!"]; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: [String!] @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/RenamedType.ts.expected.md b/src/tests/fixtures/field_values/RenamedType.ts.expected.md index e6ed6017..63233287 100644 --- a/src/tests/fixtures/field_values/RenamedType.ts.expected.md +++ b/src/tests/fixtures/field_values/RenamedType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/RenamedType.ts" /** @gqlType User */ class UserResolver { /** @gqlField */ @@ -12,10 +12,11 @@ class SomeType { /** @gqlField */ me: UserResolver; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { me: User @@ -53,3 +54,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md b/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md index 0292e546..dabb397a 100644 --- a/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md +++ b/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/RenamedTypeOutOfOrder.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -12,10 +12,11 @@ class UserResolver { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { me: User @@ -53,3 +54,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/StringField.ts.expected.md b/src/tests/fixtures/field_values/StringField.ts.expected.md index c4a78eab..a136faab 100644 --- a/src/tests/fixtures/field_values/StringField.ts.expected.md +++ b/src/tests/fixtures/field_values/StringField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/StringField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -8,10 +8,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md b/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md index 69b3feb7..9fce4a92 100644 --- a/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md +++ b/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/StringFieldKillsParentOnException.ts" /** @gqlType */ export default class SomeType { /** @@ -11,10 +11,11 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String! @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md b/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md index 8340fb97..111516d9 100644 --- a/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts" // { "nullableByDefault": false } /** @gqlType */ export default class SomeType { @@ -12,11 +12,13 @@ export default class SomeType { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts:6:7 - error: Unexpected `@killsParentOnException` tag. `@killsParentOnException` is only supported when the Grats config option `nullableByDefault` is enabled in your `tsconfig.json`. 6 * @killsParentOnException ~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/UnionField.ts.expected.md b/src/tests/fixtures/field_values/UnionField.ts.expected.md index 5e6dd3c9..c32f2d09 100644 --- a/src/tests/fixtures/field_values/UnionField.ts.expected.md +++ b/src/tests/fixtures/field_values/UnionField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/UnionField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -25,10 +25,11 @@ class Entity { * @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union Actor = Entity | User @@ -89,3 +90,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, EntityType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md b/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md index 67a6e38b..5c032e7b 100644 --- a/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md +++ b/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/non_default_nullable/NonNullablePromise.ts" // { "nullableByDefault": false } /** @gqlType */ export default class SomeType { @@ -9,10 +9,11 @@ export default class SomeType { return Promise.resolve("Hello world!"); } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String! @@ -35,3 +36,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md b/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md index 05c16424..274ca888 100644 --- a/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md +++ b/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="field_values/non_default_nullable/NullablePromise.ts" // { "nullableByDefault": false } /** @gqlType */ export default class SomeType { @@ -9,10 +9,11 @@ export default class SomeType { return Promise.resolve("Hello world!"); } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -35,3 +36,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md b/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md index 2bd22901..0b23471f 100644 --- a/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/arrayPassedToGeneric.invalid.ts" /** @gqlType */ type Page = { /** @gqlField */ @@ -26,10 +26,11 @@ type Foo = { /** @gqlField */ c: SomeType; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts:19:15 - error: Expected `SomeType` to be passed a GraphQL type argument for type parameter `T`. 19 a: SomeType; @@ -60,3 +61,4 @@ src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts:24:15 - error: Expec 10 someField: T; ~ and expects a GraphQL type because it was used in a GraphQL position here. +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md b/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md index af0b52a7..ec4aa8cb 100644 --- a/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md +++ b/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/complexMutualReferences.ts" /** @gqlType */ type Foo = { /** @gqlField */ @@ -20,10 +20,11 @@ type Baz = { /** @gqlField */ bazField: Bar; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Baz { bazField: BazBar @@ -81,3 +82,4 @@ export function getSchema(): GraphQLSchema { types: [BazType, BazBarType, BazFooType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/connection.ts.expected.md b/src/tests/fixtures/generics/connection.ts.expected.md index 1d3bc501..4e3bea96 100644 --- a/src/tests/fixtures/generics/connection.ts.expected.md +++ b/src/tests/fixtures/generics/connection.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/connection.ts" /** @gqlType */ export type Page = { /** @gqlField */ @@ -40,10 +40,11 @@ type PageInfo = { /** @gqlField */ endCursor: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Page { name: String @@ -151,3 +152,4 @@ export function getSchema(): GraphQLSchema { types: [PageType, PageConnectionType, PageEdgeType, PageInfoType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md b/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md index b4cb4133..0703ca5d 100644 --- a/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/connectionEdgeAsGeneric.ts" /** @gqlType */ export type Page = { /** @gqlField */ @@ -40,10 +40,11 @@ type PageInfo = { /** @gqlField */ endCursor: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Page { name: String @@ -151,3 +152,4 @@ export function getSchema(): GraphQLSchema { types: [PageType, PageEdgeType, PageEdgeConnectionType, PageInfoType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md b/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md index 6b65928e..4d8d0b68 100644 --- a/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/defineFieldOnGeneric.ts" /** @gqlType */ type Edge = { /** @gqlField */ @@ -21,10 +21,11 @@ type Page = { export function title(edge: Edge): string { return edge.node.title; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Page { title: String @@ -78,3 +79,4 @@ export function getSchema(): GraphQLSchema { types: [PageType, PageEdgeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/edge.ts.expected.md b/src/tests/fixtures/generics/edge.ts.expected.md index b4ab4a72..4c363ced 100644 --- a/src/tests/fixtures/generics/edge.ts.expected.md +++ b/src/tests/fixtures/generics/edge.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/edge.ts" /** @gqlType */ type Page = { /** @gqlField */ @@ -34,10 +34,11 @@ type PageInfo = { /** @gqlField */ endCursor: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Page { name: String @@ -130,3 +131,4 @@ export function getSchema(): GraphQLSchema { types: [PageType, PageConnectionType, PageEdgeType, PageInfoType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md b/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md index 2c40e26e..fd83b82f 100644 --- a/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/enumWithGeneric.invalid.ts" /** @gqlEnum */ type MyEnum = T | "someValue"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/enumWithGeneric.invalid.ts:2:18 - error: Expected `@gqlEnum` enum members to be string literal types. For example: `'foo'`. Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. 2 type MyEnum = T | "someValue"; ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericInputType.ts.expected.md b/src/tests/fixtures/generics/genericInputType.ts.expected.md index 0d097d54..243e717c 100644 --- a/src/tests/fixtures/generics/genericInputType.ts.expected.md +++ b/src/tests/fixtures/generics/genericInputType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericInputType.ts" /** @gqlInput */ type SomeInput = { someField: T; @@ -18,10 +18,11 @@ class SomeClass { return args.someArg.someField.anotherField; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input AnotherInput { anotherField: String! @@ -79,3 +80,4 @@ export function getSchema(): GraphQLSchema { types: [AnotherInputType, AnotherInputSomeInputType, SomeClassType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericInterface.ts.expected.md b/src/tests/fixtures/generics/genericInterface.ts.expected.md index 596266c0..8d5c13cf 100644 --- a/src/tests/fixtures/generics/genericInterface.ts.expected.md +++ b/src/tests/fixtures/generics/genericInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericInterface.ts" /** @gqlType */ class User implements Friendly { __typename: "User"; @@ -23,10 +23,11 @@ class Dog { /** @gqlField */ bestFriend: Friendly; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface DogFriendly { to: Dog @@ -92,3 +93,4 @@ export function getSchema(): GraphQLSchema { types: [DogFriendlyType, DogType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericOverArg.ts.expected.md b/src/tests/fixtures/generics/genericOverArg.ts.expected.md index 4b83be89..25a11ba1 100644 --- a/src/tests/fixtures/generics/genericOverArg.ts.expected.md +++ b/src/tests/fixtures/generics/genericOverArg.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericOverArg.ts" /** @gqlType */ export class SomeClass { /** @gqlField */ @@ -21,10 +21,11 @@ type Query = unknown; export function someField(_: Query): SomeClass { return new SomeClass(); } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input SomeInput { someField: String! @@ -87,3 +88,4 @@ export function getSchema(): GraphQLSchema { types: [SomeInputType, QueryType, SomeInputSomeClassType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md b/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md index 6981ac97..56e9e44f 100644 --- a/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md +++ b/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericReferencedMoreThanOnce.ts" /** @gqlType */ type Err = { __typename: "Err"; @@ -25,10 +25,11 @@ export type SomeType = { /** @gqlField */ alsoPageResult: Result; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union PageResult = Err | Page @@ -94,3 +95,4 @@ export function getSchema(): GraphQLSchema { types: [PageResultType, ErrType, PageType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md index c18a8eb3..3d9224b2 100644 --- a/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericTypeUsedAsUnionMember.invalid.ts" /** @gqlType */ type Page = { __typename: "Page"; @@ -18,11 +18,13 @@ export class Edge { /** @gqlUnion */ type SomeUnion = Page | Edge; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts:17:25 - error: Unexpected generic type used as union member. Generic type may not currently be used as members of a union. Grats requires that all union members define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus cannot be used as members of a union. 17 type SomeUnion = Page | Edge; ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md index 5319c5bd..c0c77a86 100644 --- a/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts" /** @gqlType */ type Page = { __typename: "Page"; @@ -16,11 +16,13 @@ export class Edge { /** @gqlUnion */ type SomeUnion = Page | T; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts:5:18 - error: Unexpected generic type used as union member. Generic type may not currently be used as members of a union. Grats requires that all union members define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus cannot be used as members of a union. 5 foo: SomeUnion>; ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md index e458848d..c2554938 100644 --- a/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericTypeUsingClass.ts" /** @gqlType */ type Page = { /** @gqlField */ @@ -22,10 +22,11 @@ type Query = unknown; export function createEdge(_: Query): Edge { return { node: { name: "My Page" }, cursor: "cursor" }; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Page { name: String @@ -88,3 +89,4 @@ export function getSchema(): GraphQLSchema { types: [PageType, PageEdgeType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md index 7f38f421..22590119 100644 --- a/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/genericTypeUsingInterface.ts" /** @gqlType */ type Page = { /** @gqlField */ @@ -22,10 +22,11 @@ type Query = unknown; export function createEdge(_: Query): Edge { return { node: { name: "My Page" }, cursor: "cursor" }; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Page { name: String @@ -88,3 +89,4 @@ export function getSchema(): GraphQLSchema { types: [PageType, PageEdgeType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md b/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md index 72252cee..ccf73219 100644 --- a/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/missingGqlGenericTypeArg.invalid.ts" /** @gqlType */ type Edge = { /** @gqlField */ @@ -14,10 +14,11 @@ export type PageConnection = { /** @gqlField */ edges: Edge[]; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts:12:10 - error: Missing type argument for generic GraphQL type. Expected `Edge` to be passed a GraphQL type argument for type parameter `T`. 12 edges: Edge[]; @@ -31,3 +32,4 @@ src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts:12:10 - error: M 4 node: T; ~ and expects a GraphQL type because it was used in a GraphQL position here. +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md b/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md index 75369444..4e6b6ccd 100644 --- a/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/multiparamGeneric.ts" /** @gqlUnion */ type Result = V | E; @@ -25,10 +25,11 @@ type Query = unknown; export function pageResult(_: Query): Result { return { title: "Hello", __typename: "Page" }; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union PageErrResult = Err | Page @@ -94,3 +95,4 @@ export function getSchema(): GraphQLSchema { types: [PageErrResultType, ErrType, PageType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md b/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md index f034e98a..a0eb778c 100644 --- a/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md +++ b/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/names/skippedTypeParam.ts" /** @gqlType */ type Edge = { /** @gqlField */ @@ -27,10 +27,11 @@ export function connection(): Edge { }, }; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type A { a: String @@ -103,3 +104,4 @@ export function getSchema(): GraphQLSchema { types: [AType, BType, BEdgeType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md b/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md index 06df4b1b..0c7110a5 100644 --- a/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md +++ b/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/names/skippedTypeParamPassesLiteral.ts" /** @gqlType */ type Edge = { /** @gqlField */ @@ -32,10 +32,11 @@ export function connection(): Edge< }, }; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type A { a: String @@ -108,3 +109,4 @@ export function getSchema(): GraphQLSchema { types: [AType, BType, BEdgeType, QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md b/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md index f305e171..5980a75d 100644 --- a/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/passOuptutTypeToInputType.input.invalid.ts" /** @gqlInput */ export type SomeInput = { someField: T; @@ -18,11 +18,13 @@ class SomeClass { return args.someArg.someField.someField(args); } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts:3:14 - error: The type of SomeClassSomeInput.someField must be Input Type but got: SomeClass!. 3 someField: T; ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md b/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md index 188ad33e..96f47999 100644 --- a/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/referencingMethodGeneric.invalid.ts" /** @gqlType */ type Query = unknown; @@ -8,10 +8,11 @@ type Query = unknown; export function greeting(_: Query): T { return null as any; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts:5:40 - error: Type parameter not valid 5 export function greeting(_: Query): T { @@ -21,3 +22,4 @@ src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts:5:40 - error: Ty 5 export function greeting(_: Query): T { ~ Defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/result.ts.expected.md b/src/tests/fixtures/generics/result.ts.expected.md index 7b89fdfa..ecb4d898 100644 --- a/src/tests/fixtures/generics/result.ts.expected.md +++ b/src/tests/fixtures/generics/result.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/result.ts" /** @gqlType */ type Err = { __typename: "Err"; @@ -23,10 +23,11 @@ export type SomeType = { /** @gqlField */ pageResult: Result; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union PageResult = Err | Page @@ -87,3 +88,4 @@ export function getSchema(): GraphQLSchema { types: [PageResultType, ErrType, PageType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md b/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md index a3cfe1d8..223ab7ad 100644 --- a/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/scalarPassedAsGenericArg.invalid.ts" /** @gqlType */ type Wrapper = { /** @gqlField */ @@ -12,10 +12,11 @@ type OtherType = { /** @gqlField */ wrapper: Wrapper; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts:10:20 - error: Expected `Wrapper` to be passed a GraphQL type argument for type parameter `T`. 10 wrapper: Wrapper; @@ -29,3 +30,4 @@ src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts:10:20 - error: E 4 value: T; ~ and expects a GraphQL type because it was used in a GraphQL position here. +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md b/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md index 21f922d3..e7dde38f 100644 --- a/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md +++ b/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/scalarPassedAsNonGqlGenericArg.ts" /** @gqlType */ type Wrapper = { /** @gqlField */ @@ -12,10 +12,11 @@ type OtherType = { /** @gqlField */ wrapper: Wrapper; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type OtherType { wrapper: Wrapper @@ -53,3 +54,4 @@ export function getSchema(): GraphQLSchema { types: [OtherTypeType, WrapperType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md b/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md index 71d8e581..78e32afc 100644 --- a/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md @@ -1,13 +1,14 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/scalarWithGeneric.ts" // T is not inspected by Grats, so this is fine. /** @gqlScalar */ export type MyScalar = T; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- scalar MyScalar -- TypeScript -- @@ -28,3 +29,4 @@ export function getSchema(config: SchemaConfig): GraphQLSchema { types: [MyScalarType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md b/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md index 456e5286..f42f73b7 100644 --- a/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/todo/genericInterfaceFromTypeParam.invalid.ts" /** @gqlType */ export class User implements Friendly { __typename: "User"; @@ -21,11 +21,13 @@ class Dog { /** @gqlField */ bestFriend: User; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts:2:33 - error: Unexpected `implements` on generic `gqlType`. Generic types may not currently declare themselves as implementing interfaces. Grats requires that all types which implement an interface define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus declare themselves as interface implementors. 2 export class User implements Friendly { ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md b/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md index 11bb181f..a12254dd 100644 --- a/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/todo/genericTypeImplementsInterface.invalid.ts" /** @gqlType */ export class User implements Friendly { __typename: "User"; @@ -24,11 +24,13 @@ class Dog { /** @gqlField */ bestFriend: User; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts:2:33 - error: Unexpected `implements` on generic `gqlType`. Generic types may not currently declare themselves as implementing interfaces. Grats requires that all types which implement an interface define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus declare themselves as interface implementors. 2 export class User implements Friendly { ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md b/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md index 17a0a3a2..3ea98d77 100644 --- a/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md +++ b/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/todo/genericTypeMemberOfUnion.ts" /** @gqlType */ export class User { __typename: "User"; @@ -19,10 +19,11 @@ class Dog { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Dog { name: String @@ -45,3 +46,4 @@ export function getSchema(): GraphQLSchema { types: [DogType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md b/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md index 8d57c1f7..e343f0ac 100644 --- a/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts" /** @gqlType */ type Edge = { /** @gqlField */ @@ -14,11 +14,13 @@ export type PageConnection = { /** @gqlField */ edges: Edge[]; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts:12:15 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 12 edges: Edge[]; ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/headers/customHeaders.ts.expected.md b/src/tests/fixtures/headers/customHeaders.ts.expected.md index 40b9c3bf..35690e79 100644 --- a/src/tests/fixtures/headers/customHeaders.ts.expected.md +++ b/src/tests/fixtures/headers/customHeaders.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="headers/customHeaders.ts" // {"schemaHeader": "# Generated SDL", "tsSchemaHeader": "// Generated TS"} /** @gqlType */ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- # Generated SDL @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/headers/multilineHeader.ts.expected.md b/src/tests/fixtures/headers/multilineHeader.ts.expected.md index cd5be9e5..d6ea0d25 100644 --- a/src/tests/fixtures/headers/multilineHeader.ts.expected.md +++ b/src/tests/fixtures/headers/multilineHeader.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="headers/multilineHeader.ts" // {"schemaHeader": ["# Generated SDL\n", "# multi-line"], "tsSchemaHeader": ["// Generated TS\n", "// multi-line"]} /** @gqlType */ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- # Generated SDL @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md index 86ac1fdd..67b7eefc 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfDeprecated.invalid.ts" /** * @gqlInput * @deprecated Don't use this any more */ export type Greeting = { firstName: string } | { lastName: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts:3:5 - error: Directive "@deprecated" may not be used on INPUT_OBJECT. 3 * @deprecated Don't use this any more ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md index f266623c..722e821f 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfFieldIsNullable.ts" /** * @gqlInput */ export type Greeting = { firstName: string } | { lastName: string | null }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { firstName: String @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md index d948066c..383d2d83 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfFieldIsOptional.ts" /** * @gqlInput */ export type Greeting = { firstName: string } | { lastName?: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { firstName: String @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md index fc1061a5..2ea46ed5 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts" /** * @gqlInput */ export type Greeting = { firstName: string } | { lastName }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts:4:50 - error: Expected each property of a @oneOf @gqlInput to have a type annotation. 4 export type Greeting = { firstName: string } | { lastName }; ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md index fb92a92c..622bc832 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfFieldTypeList.ts" /** * @gqlInput */ export type Greeting = { firstName: string } | { lastName: Array }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { firstName: String @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md index cac992c1..5757e93c 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfFieldTypeListOfNullable.ts" /** * @gqlInput */ export type Greeting = | { firstName: string } | { lastName: Array }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { firstName: String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md index d098588a..41bfc3f9 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts" /** * @gqlInput */ export type Greeting = { firstName: string } | { lastName: Set }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts:4:60 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 export type Greeting = { firstName: string } | { lastName: Set }; ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md index ad17a5f7..d41ef049 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts" /** * @gqlInput */ export type Greeting = | { firstName: string } | { lastName: string; nickName: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts:6:5 - error: Expected each member of a @oneOf @gqlInput to be a TypeScript object literal with exactly one property. 6 | { lastName: string; nickName: string }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md index e4ba6456..3543a51c 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfMemberHasNoField.invalid.ts" /** * @gqlInput */ type Greeting = { firstName: string } | {}; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts:4:41 - error: Expected each member of a @oneOf @gqlInput to be a TypeScript object literal with exactly one property. 4 type Greeting = { firstName: string } | {}; ~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md index b4302d00..0bd1eb78 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts" /** * @gqlInput */ export type Greeting = string | { name: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts:4:24 - error: Expected each member of a @oneOf @gqlInput to be a TypeScript object literal with exactly one property. 4 export type Greeting = string | { name: string }; ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md index 75225ffa..8e74332f 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfWithFieldDescription.ts" // Known issue, descriptions are not parsed? /** @@ -11,10 +11,11 @@ export type Greeting = | { firstName: string } /** Last Name */ | { lastName: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { firstName: String @@ -43,3 +44,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md index 2ff229f8..19a692e7 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts" // Known issue, descriptions are not parsed? /** @@ -15,10 +15,11 @@ export type Greeting = /** Last Name */ lastName: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { """First Name""" @@ -51,3 +52,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md index b2f5f267..dd6af796 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/oneOfWithTypeDescription.ts" /** * A popular way to greet someone. * * @gqlInput */ export type Greeting = { firstName: string } | { lastName: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """A popular way to greet someone.""" input Greeting @oneOf { @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md b/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md index 9330fcb9..4551d670 100644 --- a/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/simpleOneOf.ts" /** * @gqlInput */ export type Greeting = { firstName: string } | { lastName: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input Greeting @oneOf { firstName: String @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [GreetingType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md index 89a58111..604f4bbd 100644 --- a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts" /** * @gqlInput * @oneOf */ export type Greeting = { firstName: string } | { lastName: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts:3:4 - error: The `@oneOf` tag has been deprecated. Grats will now automatically add the `@oneOf` directive if you define your input type as a TypeScript union. You can remove the `@oneOf` tag. @@ -38,3 +39,4 @@ src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts:3:4 - e * @gqlInput * */ export type Greeting = { firstName: string } | { lastName: string }; +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md b/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md index d8a77a93..fbbc3916 100644 --- a/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/ContextReferencedInInputType.invalid.ts" /** @gqlContext */ type SomeType = { hello: string; @@ -10,10 +10,11 @@ type SomeType = { type MyInputType = { someField: SomeType; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts:8:14 - error: Cannot use `gqlContext` as a type in GraphQL type position. 8 someField: SomeType; @@ -23,3 +24,4 @@ src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts:8:14 - er 1 /** @gqlContext */ ~~~~~~~~~~~~ Defined here +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md b/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md index 598c4bfb..f0a0e3f0 100644 --- a/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/DeprecatedInputType.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -15,11 +15,13 @@ export class SomeType { type MyInputType = { someField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts:10:5 - error: Directive "@deprecated" may not be used on INPUT_OBJECT. 10 * @deprecated This old thing? ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputType.ts.expected.md b/src/tests/fixtures/input_types/InputType.ts.expected.md index 01932792..813b5100 100644 --- a/src/tests/fixtures/input_types/InputType.ts.expected.md +++ b/src/tests/fixtures/input_types/InputType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputType.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -11,10 +11,11 @@ class SomeType { type MyInputType = { someField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input MyInputType { someField: String! @@ -52,3 +53,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md index 68ae4fb7..08a1981a 100644 --- a/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeInterface.ts" /** @gqlInput */ interface MyInputType { someField: string; @@ -13,10 +13,11 @@ class User { return args.input.someField; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input MyInputType { someField: String! @@ -59,3 +60,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md index b04feea7..2b63cab7 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md @@ -1,19 +1,21 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeInterfaceFunction.invalid.ts" /** @gqlInput */ interface MyInputType { // TypeScript lets you define functions using interfaces, // but that makes no sense as a GraphQL input type. (arg: string): string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts:5:3 - error: `@gqlInput` types only support property signature members. e.g. `type MyInput = { foo: string }` If you think Grats should be able to infer this input field, please report an issue at https://github.com/captbaritone/grats/issues. 5 (arg: string): string; ~~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md index bd76fc98..3d850f0c 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeInterfaceMethod.invalid.ts" /** @gqlInput */ interface MyInputType { someMethod(): string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts:3:3 - error: `@gqlInput` types only support property signature members. e.g. `type MyInput = { foo: string }` If you think Grats should be able to infer this input field, please report an issue at https://github.com/captbaritone/grats/issues. 3 someMethod(): string; ~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md index 4ce12108..6e761054 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeInterfaceOptionalField.ts" /** @gqlInput */ interface MyInputType { someField?: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input MyInputType { someField: String @@ -31,3 +32,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md index 99b44353..e6cc4407 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeInterfacePromiseField.invalid.ts" /** @gqlInput */ interface MyInputType { someMethod: Promise; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts:3:15 - error: `Promise` is not a valid as an input type. 3 someMethod: Promise; ~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md index 2a7cdd23..58e3904f 100644 --- a/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeMergedInterface.invalid.ts" interface MyInputType { secretConfusingField: string; } @@ -9,10 +9,11 @@ interface MyInputType { interface MyInputType { someField: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts:6:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces @@ -24,3 +25,4 @@ src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts:6:11 - error: 1 interface MyInputType { ~~~~~~~~~~~ Other declaration +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md b/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md index 9e6f4488..c42aa503 100644 --- a/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeOptionalField.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -11,10 +11,11 @@ class SomeType { type MyInputType = { someField?: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input MyInputType { someField: String @@ -52,3 +53,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md index ba85af88..cec81669 100644 --- a/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeReferencingOutputType.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -11,11 +11,13 @@ class SomeType { type MyInputType = { someField: SomeType; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts:9:14 - error: The type of MyInputType.someField must be Input Type but got: SomeType!. 9 someField: SomeType; ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md index bb0e1134..1d6b92f3 100644 --- a/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeReturnedFromField.invalid.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -17,10 +17,11 @@ class MyType { type MyInputType = { someField: MyType; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts:15:14 - error: The type of MyInputType.someField must be Input Type but got: MyType!. 15 someField: MyType; @@ -29,3 +30,4 @@ src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts:10:16 - err 10 someField(): MyInputType; ~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md index fe6a8533..9a780984 100644 --- a/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeWithDeprecatedField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -14,10 +14,11 @@ type MyInputType = { */ someField?: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input MyInputType { """Sweet field!""" @@ -58,3 +59,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md index 0e8b5246..8de9d0b8 100644 --- a/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeWithDeprecatedRequiredField.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -14,10 +14,11 @@ type MyInputType = { */ someField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts:10:7 - error: Required input field MyInputType.someField cannot be deprecated. 10 * @deprecated Sweet, but stale @@ -27,3 +28,4 @@ src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts:1 12 someField: string; ~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md index 89644248..ab157a27 100644 --- a/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeWithDescription.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -14,10 +14,11 @@ class SomeType { type MyInputType = { someField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """Check out this great input!""" input MyInputType { @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md index 92bd92cd..4a5a5046 100644 --- a/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/InputTypeWithFieldDescription.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -12,10 +12,11 @@ type MyInputType = { /** Sweet field! */ someField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input MyInputType { """Sweet field!""" @@ -55,3 +56,4 @@ export function getSchema(): GraphQLSchema { types: [MyInputTypeType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md b/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md index 9ab5c957..fb376309 100644 --- a/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md +++ b/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/RenamedInputType.ts" /** @gqlType */ class SomeType { /** @gqlField */ @@ -11,10 +11,11 @@ class SomeType { type MyInputType = { someField: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- input OtherName { someField: String! @@ -52,3 +53,4 @@ export function getSchema(): GraphQLSchema { types: [OtherNameType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md index 8454ee89..ba9cacc8 100644 --- a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="input_types/inputFieldWithGqlField.invalid.ts" /** @gqlInput */ type Foo = { /** @gqlField */ name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts:3:7 - error: The tag `@gqlField` is not needed on fields of input types. All fields are automatically included as part of the input type. This tag can be safely removed. @@ -36,3 +37,4 @@ type Foo = { name: string; }; +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md b/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md index c4a86aa5..29c2a5dd 100644 --- a/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/FieldReturnsInterface.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -21,10 +21,11 @@ class User implements IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { name: String @@ -80,3 +81,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md b/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md index 97e93528..b709079c 100644 --- a/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md +++ b/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/IgnoresExtendsClause.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -25,10 +25,11 @@ class User extends Person implements Actor { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Actor { name: String @@ -84,3 +85,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md index ac482c20..83ac6e4a 100644 --- a/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/ImplementsInterface.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -21,10 +21,11 @@ class User implements Person { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { name: String @@ -80,3 +81,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md index 0c0fbc18..4f1b80e1 100644 --- a/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/ImplementsInterfaceWithTypeParam.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -25,10 +25,11 @@ class User implements Person { other: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { name: String @@ -84,3 +85,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md index 272807f7..e6d28253 100644 --- a/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/ImplementsMultipleInterfaces.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -27,10 +27,11 @@ class User implements Person, Actor { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Actor { name: String @@ -101,3 +102,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, PersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md index 16852311..444ea6a8 100644 --- a/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/ImplementsRenamedInterface.ts" /** @gqlInterface Person */ interface DONT_USE_THIS { /** @gqlField */ @@ -13,10 +13,11 @@ class User implements DONT_USE_THIS { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { name: String @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md index e77999fa..303d4cde 100644 --- a/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceDefinitionExtendsGqlInterface.ts" import { Int } from "../../../Types"; /** @gqlInterface */ @@ -28,10 +28,11 @@ export interface User extends Mammal, Person { /** @gqlField */ legs: Int; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Mammal { legs: Int @@ -100,3 +101,4 @@ export function getSchema(): GraphQLSchema { types: [MammalType, PersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md index f722ceb9..f4a884e5 100644 --- a/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceExtendsInterface.ts" /** @gqlInterface Node */ interface GqlNode { /** @gqlField */ @@ -20,10 +20,11 @@ interface Actor extends GqlNode, Person { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Actor implements Node & Person { id: String @@ -84,3 +85,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, NodeType, PersonType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md index 483159d3..6d713a6c 100644 --- a/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceFieldWithDescription.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -24,10 +24,11 @@ class User implements IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson { """The person's name""" @@ -85,3 +86,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md index 69795873..0788d5bf 100644 --- a/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -27,10 +27,11 @@ class User implements IPerson { */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson { """The person's name""" @@ -90,3 +91,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md index f722ceb9..ca31c9de 100644 --- a/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceImplementsInterface.ts" /** @gqlInterface Node */ interface GqlNode { /** @gqlField */ @@ -20,10 +20,11 @@ interface Actor extends GqlNode, Person { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Actor implements Node & Person { id: String @@ -84,3 +85,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, NodeType, PersonType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md index 6b4e9339..178cae95 100644 --- a/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceMergedIntoClass.invalid.ts" class Foo { someField: number; } @@ -10,10 +10,11 @@ interface Foo { /** @gqlField */ id: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts:6:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces @@ -25,3 +26,4 @@ src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts:6:11 - error: 1 class Foo { ~~~ Other declaration +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md index cfc984d8..0d292eb5 100644 --- a/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceMergedIntoObject.ts" declare const Foo: { prototype: Foo; new (): Foo; @@ -11,10 +11,11 @@ interface Foo { /** @gqlField */ id: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Foo { id: String @@ -37,3 +38,4 @@ export function getSchema(): GraphQLSchema { types: [FooType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md index e2528f06..0c747980 100644 --- a/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceMissingFields.invalid.ts" /** @gqlInterface */ interface SomeType {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts:2:11 - error: Interface `SomeType` must define one or more fields. Define a field by adding `/** @gqlField */` above a field, property, attribute or method of this type, or above a function that has `SomeType` as its first argument. 2 interface SomeType {} ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md index 8ad54388..a05a659c 100644 --- a/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceWithCustomName.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -21,10 +21,11 @@ class User implements IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { name: String @@ -80,3 +81,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md index 57112ef7..9312d662 100644 --- a/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceWithDeprecatedField.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -23,10 +23,11 @@ class User implements IPerson { /** @gqlField */ name?: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson { name: String @deprecated(reason: "Not used anymore") @@ -83,3 +84,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md index 722d6717..136fb5d9 100644 --- a/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/InterfaceWithDescription.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -25,10 +25,11 @@ class User implements IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """An interface describing the common elements of all people types.""" interface IPerson { @@ -86,3 +87,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md b/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md index 7067e8bd..4bb981f0 100644 --- a/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/MergedInterfaces.invalid.ts" import { ID } from "../../../types"; /** @gqlType */ @@ -20,10 +20,11 @@ interface Node { /** @gqlField */ id: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts:16:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces @@ -35,3 +36,4 @@ src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts:16:11 - error: Unexpec 11 interface Node { ~~~~ Other declaration +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md index 6378717b..9cfbe95b 100644 --- a/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md @@ -1,13 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/TagAttachedToWrongNode.invalid.ts" /** @gqlInterface Person */ function Foo() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlInterface` can only be used on interface declarations. e.g. `interface MyInterface {}` 1 /** @gqlInterface Person */ ~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md b/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md index 60420596..869bc17d 100644 --- a/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md +++ b/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/extendInterfaceWithNonGqlType.ts" interface IThing { name: string; } @@ -12,10 +12,11 @@ export interface IPerson extends IThing { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson { name: String @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md b/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md index ffb92716..428a0f3a 100644 --- a/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts" /** @gqlImplements Node */ function hello() { return "world"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts:1:6 - error: `@gqlImplements` has been deprecated. Instead use `class MyType implements MyInterface`. 1 /** @gqlImplements Node */ ~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md b/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md index d8472fa0..2ad90209 100644 --- a/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md @@ -1,11 +1,13 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/fieldOnScalar.invalid.ts" // Locate: Date.name /** @gqlScalar */ export type Date = string; +``` + +## Output ------------------ -OUTPUT ------------------ -Cannot locate field `name` on type `Date`. Only object types, interfaces, and input objects have fields. \ No newline at end of file +``` +Cannot locate field `name` on type `Date`. Only object types, interfaces, and input objects have fields. +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/genericType.invalid.ts.expected.md b/src/tests/fixtures/locate/genericType.invalid.ts.expected.md index 87383ae7..fac772ce 100644 --- a/src/tests/fixtures/locate/genericType.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/genericType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/genericType.invalid.ts" // Locate: PageEdge /** @gqlType */ @@ -36,11 +36,13 @@ type PageInfo = { /** @gqlField */ endCursor: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/genericType.invalid.ts:20:10 - error: Located here 20 edges: Edge[]; ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md b/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md index 45b05e7d..db3c2ad2 100644 --- a/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/genericTypeField.invalid.ts" // Locate: PageEdge.cursor /** @gqlType */ @@ -36,11 +36,13 @@ type PageInfo = { /** @gqlField */ endCursor: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/genericTypeField.invalid.ts:14:3 - error: Located here 14 cursor: string; ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/inputType.invalid.ts.expected.md b/src/tests/fixtures/locate/inputType.invalid.ts.expected.md index 97eb034e..363847d1 100644 --- a/src/tests/fixtures/locate/inputType.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/inputType.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/inputType.invalid.ts" // Locate: User /** @gqlInput */ type User = { name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/inputType.invalid.ts:3:6 - error: Located here 3 type User = { ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md b/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md index 8ccd0d74..79f78c07 100644 --- a/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/inputTypeField.invalid.ts" // Locate: User.name /** @gqlInput */ type User = { name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/inputTypeField.invalid.ts:4:3 - error: Located here 4 name: string; ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/interface.invalid.ts.expected.md b/src/tests/fixtures/locate/interface.invalid.ts.expected.md index 5df4b484..36cef52e 100644 --- a/src/tests/fixtures/locate/interface.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/interface.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/interface.invalid.ts" // Locate: Person /** @gqlInterface */ interface Person { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/interface.invalid.ts:3:11 - error: Located here 3 interface Person { ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md b/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md index 2606af41..e7ef3da8 100644 --- a/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/malformedEntitySyntax.invalid.ts" // Locate: User->name /** @gqlType */ type User = { /** @gqlField */ name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ -Invalid entity name: `User->name`. Expected `ParentType` or `ParentType.fieldName`. \ No newline at end of file +``` +Invalid entity name: `User->name`. Expected `ParentType` or `ParentType.fieldName`. +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md b/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md index f5409c94..b77b445b 100644 --- a/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/notFoundField.invalid.ts" // Locate: User.not_a_field /** @gqlType */ type User = { /** @gqlField */ name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ -Cannot locate field `not_a_field` on type `User`. \ No newline at end of file +``` +Cannot locate field `not_a_field` on type `User`. +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md b/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md index b4d96713..5fff679a 100644 --- a/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md @@ -1,14 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/notFoundType.invalid.ts" // Locate: WhoopsNotARealType /** @gqlType */ type User = { /** @gqlField */ name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ -Cannot locate type `WhoopsNotARealType`. \ No newline at end of file +``` +Cannot locate type `WhoopsNotARealType`. +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/type.invalid.ts.expected.md b/src/tests/fixtures/locate/type.invalid.ts.expected.md index 48822893..5de03a66 100644 --- a/src/tests/fixtures/locate/type.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/type.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/type.invalid.ts" // Locate: User /** @gqlType */ type User = { /** @gqlField */ name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/type.invalid.ts:3:6 - error: Located here 3 type User = { ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/typeField.invalid.ts.expected.md b/src/tests/fixtures/locate/typeField.invalid.ts.expected.md index f7e3f654..adbdae81 100644 --- a/src/tests/fixtures/locate/typeField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/typeField.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="locate/typeField.invalid.ts" // Locate: User.name /** @gqlType */ type User = { /** @gqlField */ name: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/locate/typeField.invalid.ts:5:3 - error: Located here 5 name: string; ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md b/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md index 2140189e..f701f6cd 100644 --- a/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md +++ b/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="regression/fieldFollowedByDeprecated.ts" /** @gqlType */ class User { /** @@ -11,10 +11,11 @@ class User { return "Sup"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type User { name: String @deprecated @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md b/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md index 4ead0dc6..2345943b 100644 --- a/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ClassMethodWithContextValue.ts" /** @gqlContext */ type GratsContext = { greeting: string; @@ -13,10 +13,11 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -42,3 +43,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md index 985135e1..4f65b1c5 100644 --- a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ClassMethodWithContextValueExported.ts" /** @gqlContext */ export type GratsContext = { greeting: string; @@ -13,10 +13,11 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -42,3 +43,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md index b1954351..0e67fcf5 100644 --- a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts" type GratsContext = { greeting: string; }; @@ -12,11 +12,13 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts:8:17 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 8 greeting(ctx: GratsContext): string { ~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md index 29263371..0c9e1db9 100644 --- a/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueBeforeArgs.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -11,10 +11,11 @@ export class SomeType { /** @gqlContext */ type SomeOtherType = { greeting?: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting(fallbackGreeting: String!): String @@ -45,3 +46,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md index af33b9e0..73959375 100644 --- a/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueMissingTypeAnnotation.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts:4:12 - error: Missing type annotation for resolver argument. Expected all resolver arguments to have an explicit type annotation. Grats needs to be able to see the type of the arguments to generate an executable GraphQL schema. 4 greeting(ctx): string { ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md index c3e90748..488212d7 100644 --- a/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueOptional.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -14,10 +14,11 @@ export class SomeType { /** @gqlContext */ type SomeOtherType = { greeting: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -43,3 +44,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md index 45b9d893..aef50102 100644 --- a/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueReadTwice.ts" // No valid reason to do this, but just asserting that it works, since it happens to. /** @gqlType */ @@ -13,10 +13,11 @@ export class SomeType { /** @gqlContext */ type SomeOtherType = { greeting?: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -42,3 +43,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md index 36395eef..583719c1 100644 --- a/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueSpread.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -11,11 +11,13 @@ export class SomeType { /** @gqlContext */ type SomeOtherType = { greeting: string }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts:4:12 - error: Unexpected spread argument in resolver. Grats expects all resolver arguments to be a single, explicitly-typed argument. 4 greeting(...ctx: SomeOtherType[]): string { ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md index c9b2df03..8d49de27 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueTypeNotDefined.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -8,11 +8,13 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts:4:17 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 greeting(ctx: ThisIsNeverDefined): string { ~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md index 0f6340e4..ccfd0f1d 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueTypedAsAny.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -8,13 +8,15 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts:4:17 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. 4 greeting(ctx: any): string { ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md index 7eaf104a..627f6682 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueTypedAsNever.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -8,13 +8,15 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts:4:17 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. 4 greeting(ctx: never): string { ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md index 4ff5d588..09396be1 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/ContextValueTypedAsUnknown.invalid.ts" /** @gqlType */ export class SomeType { /** @gqlField */ @@ -8,13 +8,15 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts:4:17 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. 4 greeting(ctx: unknown): string { ~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md b/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md index acbb3ed9..e8f2f4d0 100644 --- a/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md +++ b/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/FunctionWithContextValue.ts" /** @gqlContext */ type GratsContext = { greeting: string; @@ -13,10 +13,11 @@ export class User {} export function greeting(_: User, ctx: GratsContext): string { return ctx.greeting; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type User { greeting: String @@ -43,3 +44,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md b/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md index 7feaa158..1c0499e0 100644 --- a/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md +++ b/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/MultipleClassMethodsReferencingContextValue.ts" /** @gqlContext */ type GratsContext = { greeting: string; @@ -18,10 +18,11 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { alsoGreeting: String @@ -55,3 +56,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md index 4ec1684b..d428af35 100644 --- a/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_context/MultipleContextValuesUsed.invalid.ts" /** @gqlContext */ type GratsContext = { greeting: string; @@ -22,10 +22,11 @@ export class SomeType { return ctx.greeting; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts:6:5 - error: Unexpected duplicate `@gqlContext` tag. Only one type in a project may be annotated with the `@gqlContext`. 6 /** @gqlContext */ @@ -35,3 +36,4 @@ src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts:6:5 - e 1 /** @gqlContext */ ~~~~~~~~~~~~ `@gqlContext` previously defined here. +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md b/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md index 985c2d9f..4297f857 100644 --- a/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md +++ b/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_info/ClassMethodWithInfoValue.ts" import { GqlInfo } from "../../../Types"; /** @gqlType */ @@ -10,10 +10,11 @@ export class SomeType { return "Hello"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md b/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md index 8f9a0c23..049cf66b 100644 --- a/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md +++ b/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_info/FunctionWithInfoValue.ts" import { GqlInfo } from "../../../Types"; /** @gqlField */ @@ -10,10 +10,11 @@ export function greetz(_: Query, info: GqlInfo): string { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greetz: String @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md b/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md index 79f78ae6..39fbd668 100644 --- a/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md +++ b/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolver_info/StaticMethodWithInfoValue.ts" import { GqlInfo } from "../../../Types"; /** @gqlType */ @@ -16,10 +16,11 @@ export class SomeType { /** @gqlType */ type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greeting: String @@ -62,3 +63,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md b/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md index d5ef309c..96e64508 100644 --- a/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts" /** @gqlInterface */ interface IPerson { /** @@ -22,10 +22,11 @@ export class User implements IPerson { return "Alice"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts:4:7 - error: Interface field IPerson.name expects type String! but User.name is type String. 4 * @killsParentOnException @@ -35,3 +36,4 @@ src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts: 15 name(): string | null { ~~~~~~~~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md index 0a5b0fa2..e649dd4e 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="semantic_nullability/semanticNonNull.ts" // { "strictSemanticNullability": true } /** @gqlType */ @@ -13,10 +13,11 @@ export class User { return "Alice"; } } +``` ------------------ -OUTPUT ------------------ +## Output + +``` -- SDL -- """ Indicates that a position is semantically non null: it is only null if there is a matching error in the `errors` array. @@ -92,3 +93,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md index b81f66c7..6c6930ce 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts" // { "strictSemanticNullability": true } /** @gqlInterface */ @@ -21,10 +21,11 @@ export class User implements IPerson { return "Alice"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts:6:11 - error: Interface field `User.name` expects a non-nullable type but `IPerson.name` is nullable. 6 name(): string; @@ -34,3 +35,4 @@ src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.inv 14 name(): string | null { ~~~~~~~~~~~~~ Related location +``` \ No newline at end of file diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md index 0fa9407e..c1a8a54f 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="semantic_nullability/semanticNonNullMatchesInterface.ts" // { "strictSemanticNullability": true } /** @gqlInterface */ @@ -20,10 +20,11 @@ export class User implements IPerson { return "Alice"; } } +``` ------------------ -OUTPUT ------------------ +## Output + +``` -- SDL -- """ Indicates that a position is semantically non null: it is only null if there is a matching error in the `errors` array. @@ -117,3 +118,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md index 9e02461f..0ad4c2ca 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="semantic_nullability/semanticNull.ts" // { "strictSemanticNullability": true } /** @gqlType */ @@ -16,10 +16,11 @@ export class User { return "Alice"; } } +``` ------------------ -OUTPUT ------------------ +## Output + +``` -- SDL -- """ Indicates that a position is semantically non null: it is only null if there is a matching error in the `errors` array. @@ -86,3 +87,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md b/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md index 968af335..8a725171 100644 --- a/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md +++ b/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="subscriptions/InputTypeWithAsyncIterable.invalid.ts" /** @gqlInput */ export type NotSubscription = { greetings: AsyncIterable; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts:3:14 - error: `AsyncIterable` is not a valid as an input type. 3 greetings: AsyncIterable; ~~~~~~~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md b/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md index ce1827bb..b3038960 100644 --- a/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md +++ b/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="subscriptions/InterfaceWithAsyncIterable.ts" /** @gqlInterface */ export interface NotSubscription { /** @gqlField */ greetings(): AsyncIterable; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface NotSubscription { greetings: [String!] @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [NotSubscriptionType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md b/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md index 01b29426..752b4cdf 100644 --- a/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md +++ b/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="subscriptions/NonSubscriptionClassWithAsyncIterable.ts" // { "nullableByDefault": false } /** @gqlType */ export class User { @@ -24,10 +24,11 @@ export class User { null; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type User { greetings: [String!]! @@ -65,3 +66,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md b/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md index c51fd9d9..0a4ec7c3 100644 --- a/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md +++ b/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts" /** @gqlType */ export class Subscription { /** @gqlField */ @@ -9,11 +9,13 @@ export class Subscription { yield "World"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts:2:14 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 export class Subscription { ~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md b/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md index 9d339077..b92522de 100644 --- a/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md +++ b/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts" // { "nullableByDefault": false } /** @gqlType */ export type Subscription = unknown; @@ -34,10 +34,11 @@ export async function* maybeGreetingsMaybe( ): AsyncIterable | null { return null; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Subscription { greetings: String! @@ -101,3 +102,4 @@ export function getSchema(): GraphQLSchema { types: [SubscriptionType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md b/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md index b6dd02ea..460115af 100644 --- a/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md +++ b/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="todo/EnumFromUnionTypeWithVariantWithDescription.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -13,10 +13,11 @@ type MyEnum = | "VALID" /** INVALIDATED! */ | "INVALID"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- enum MyEnum { INVALID @@ -55,3 +56,4 @@ export function getSchema(): GraphQLSchema { types: [MyEnumType, SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md b/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md index 3f410dac..d787ce22 100644 --- a/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md +++ b/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md @@ -1,12 +1,13 @@ ------------------ -INPUT ------------------ +## input + +```ts title="todo/RedefineBuiltinScalar.ts" /** @gqlScalar String */ export type MyUrl = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- -- TypeScript -- @@ -16,3 +17,4 @@ export function getSchema(): GraphQLSchema { types: [] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/todo/userExample.ts.expected.md b/src/tests/fixtures/todo/userExample.ts.expected.md index e820b983..fd332679 100644 --- a/src/tests/fixtures/todo/userExample.ts.expected.md +++ b/src/tests/fixtures/todo/userExample.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="todo/userExample.ts" /** @gqlType */ type SomeType = {}; @@ -21,10 +21,11 @@ type User = { export function fullName(user: User): string { return `${user.firstName} ${user.lastName}`; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { me: User @@ -79,3 +80,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/queryField.ts.expected.md b/src/tests/fixtures/top_level_fields/queryField.ts.expected.md index 985cfd92..deac580b 100644 --- a/src/tests/fixtures/top_level_fields/queryField.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryField.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/queryField.ts" /** @gqlQueryField */ export function greeting(): string { return "Hello world"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greeting: String @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md index 67f57ae3..3ae0c147 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md @@ -1,17 +1,19 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/queryFieldOnMethod.invalid.ts" export class SomeNonGraphQLClass { /** @gqlQueryField */ greeting(): string { return "Hello world"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts:2:7 - error: `@gqlQueryField` can only be used on function or static method declarations. 2 /** @gqlQueryField */ ~~~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md index 3cc3d846..4dd70ed9 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/queryFieldOnStaticMethod.ts" export class SomeNonGraphQLClass { /** @gqlQueryField */ static greeting(): string { return "Hello world"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greeting: String @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md index 9f484193..73ee05a9 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/queryFieldRenamed.ts" /** @gqlQueryField greeting */ export function greetz(): string { return "Hello world"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { greeting: String @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md index d4b1beec..d25fba2b 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts" /** @gqlQueryField */ export function greeting(): string { return "Hello world"; @@ -11,10 +11,11 @@ export function greeting(): string { * * @gqlType */ export type Query = unknown; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """ I might want to explicitly define a type here to provide a description. @@ -46,3 +47,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md index 80230fef..2bfecf8b 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/queryFieldWithFirstArgParentType.invalid.ts" /** @gqlType */ type Query = unknown; @@ -8,11 +8,13 @@ type Query = unknown; export function greeting(_: Query): string { return "Hello world"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts:5:29 - error: The type of Query.greeting(_:) must be Input Type but got: Query!. 5 export function greeting(_: Query): string { ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md b/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md index 359316e5..f748b02d 100644 --- a/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/rootFields.ts" import { Int } from "../../../Types"; /** @gqlQueryField */ export function greeting(): string { @@ -19,10 +19,11 @@ export async function* range(from: Int): AsyncIterable { yield i; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Mutation { deleteSomething: String @@ -96,3 +97,4 @@ export function getSchema(): GraphQLSchema { types: [MutationType, QueryType, SubscriptionType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md b/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md index 9cbadf63..2505b685 100644 --- a/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts" /** @gqlSubscriptionField */ export function foo(): string { return "Hello"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts:2:24 - error: Expected fields on `Subscription` to return an `AsyncIterable`. Fields on `Subscription` model a subscription, which is a stream of events. Grats expects fields on `Subscription` to return an `AsyncIterable` which can be used to model this stream. 2 export function foo(): string { ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md b/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md index d1726422..b7d950cc 100644 --- a/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/ClassImplementsNonGqlInterface.ts" /** * The root of all evil. * @gqlType @@ -13,10 +13,11 @@ export default class User implements IPerson { interface IPerson { hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type User { @@ -41,3 +42,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md index 51870c5e..03a5da22 100644 --- a/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md @@ -1,15 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/ClassMissingFields.invalid.ts" /** @gqlType */ export default class SomeType {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts:2:22 - error: Type `SomeType` must define one or more fields. Define a field by adding `/** @gqlField */` above a field, property, attribute or method of this type, or above a function that has `SomeType` as its first argument. 2 export default class SomeType {} ~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md b/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md index 16b161f1..def4d8b0 100644 --- a/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/ClassWithDescription.ts" /** * The root of all evil. * @@ -10,10 +10,11 @@ export default class SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type SomeType { @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md b/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md index ee9aed25..22d6a0ca 100644 --- a/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/ClassWithDescriptionAndCustomName.ts" /** * The root of all evil. * @@ -10,10 +10,11 @@ export default class NotQuery { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type SomeType { @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md index 4e72d502..b9ef61ea 100644 --- a/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/ClassWithoutAName.invalid.ts" /** * @gqlType */ @@ -10,10 +10,11 @@ export default class { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts:4:1 - error: Unexpected `@gqlType` annotation on unnamed class declaration. Grats uses the name of the class to derive the name of the GraphQL type. Consider naming the class. 4 export default class { @@ -25,3 +26,4 @@ src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts:4:1 - error: Un ~~~ 9 } ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md index b6982e0c..1c5dc03e 100644 --- a/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/QueryAsClass.invalid.ts" /** @gqlType */ export default class Query { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts:2:22 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 export default class Query { ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md index 9f191fe9..a40dc07c 100644 --- a/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/RenamedType.ts" /** * @gqlType SomeType */ @@ -10,10 +10,11 @@ class MyClass { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -36,3 +37,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md index c40f2dc1..5f4709ea 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/RenamedTypeHasDash.invalid.ts" /** * @gqlType Some-Type */ @@ -10,13 +10,15 @@ class MyClass { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts:2:4 - error: Names must only contain [_a-zA-Z0-9] but "Some-Type" does not. 2 * @gqlType Some-Type ~~~~~~~~~~~~~~~~~~ 3 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md index 5794df8f..9d49540d 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/RenamedTypeNewLine.invalid.ts" /** * @gqlType * @@ -12,10 +12,11 @@ class MyClass { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts:2:4 - error: Expected the GraphQL name `SomeType` to be on the same line as it's `@gqlType` tag. 2 * @gqlType @@ -26,3 +27,4 @@ src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts:2:4 - error: E ~~~~~~~~~~~ 5 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md index 4912b428..fd43a528 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/RenamedTypeStartsWithNumber.invalid.ts" /** * @gqlType 1SomeType */ @@ -10,13 +10,15 @@ class MyClass { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts:2:4 - error: Names must start with [_a-zA-Z] but "1SomeType" does not. 2 * @gqlType 1SomeType ~~~~~~~~~~~~~~~~~~ 3 */ ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md index e1fd9a3e..3c57e1c4 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/RenamedTypeWithoutClassName.invalid.ts" /** * @gqlType SomeType */ @@ -10,10 +10,11 @@ export default class { return "Hello world!"; } } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts:4:1 - error: Unexpected `@gqlType` annotation on unnamed class declaration. Grats uses the name of the class to derive the name of the GraphQL type. Consider naming the class. 4 export default class { @@ -25,3 +26,4 @@ src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts:4:1 - ~~~ 9 } ~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md index 74e2ecec..5c2f42bb 100644 --- a/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md @@ -1,13 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/TagAttachedToWrongNode.invalid.ts" /** @gqlType */ function MyFunc() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlType` can only be used on class, interface or type declarations. e.g. `class MyType {}` 1 /** @gqlType */ ~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md index 70e7c4ae..66ce745d 100644 --- a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/TypeFromClassDefinitionImplementsInterface.ts" /** @gqlInterface */ interface Person { /** @gqlField */ @@ -13,10 +13,11 @@ export default class User implements Person { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { hello: String @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md index 356e3def..1c386136 100644 --- a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts" /** @gqlInterface */ interface Person { /** @gqlField */ @@ -16,10 +16,11 @@ export default class User { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts:9:4 - error: `@gqlImplements` has been deprecated. Instead use `class MyType implements MyInterface`. 9 * @gqlImplements Person @@ -30,3 +31,4 @@ src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWi 9 * @gqlImplements Person ~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md index ea4a8914..57369f16 100644 --- a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts" /** @gqlInterface Node */ interface GqlNode { /** @gqlField */ @@ -22,10 +22,11 @@ export default class User implements Person, GqlNode { /** @gqlField */ id: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Node { id: String @@ -86,3 +87,4 @@ export function getSchema(): GraphQLSchema { types: [NodeType, PersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md index 6e1e5da0..1f970962 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md @@ -1,14 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts" /** @gqlType */ export type SomeType = { hello: string; }[]; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts:2:24 - error: Expected `@gqlType` type to be an object type literal (`{ }`) or `unknown`. For example: `type Foo = { bar: string }` or `type Query = unknown`. 2 export type SomeType = { @@ -17,3 +18,4 @@ src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts ~~~~~~~~~~~~~~~~ 4 }[]; ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md index d1418ba3..a1307a43 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md @@ -1,13 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts" /** @gqlType */ export type SomeType = 10; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts:2:24 - error: Expected `@gqlType` type to be an object type literal (`{ }`) or `unknown`. For example: `type Foo = { bar: string }` or `type Query = unknown`. 2 export type SomeType = 10; ~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md index 1cde3e13..709084c1 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasOfUnknownDefinesType.ts" /** @gqlType */ export type SomeType = unknown; @@ -8,10 +8,11 @@ export type SomeType = unknown; export function greeting(_: SomeType): string { return "Hello world"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { greeting: String @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md index 3c847830..8ecb0c09 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasType.ts" /** @gqlType */ export type SomeType = { /** @gqlField */ hello: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md index 37d1f8f2..3bf33027 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts" /** * @gqlType * @gqlImplements Person @@ -16,10 +16,11 @@ interface Person { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts:3:4 - error: `@gqlImplements` has been deprecated. Types which implement GraphQL interfaces should be defined using TypeScript class or interface declarations. 3 * @gqlImplements Person @@ -30,3 +31,4 @@ src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.inva 3 * @gqlImplements Person ~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md index 404a1a30..55fab30f 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasWithDescription.ts" /** * The root of all evil. * @@ -10,10 +10,11 @@ export type SomeType = { /** @gqlField */ hello: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type SomeType { @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md index d70cec8b..7068181d 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts" /** * The root of all evil. * @@ -10,10 +10,11 @@ export type NotQuery = { /** @gqlField */ hello: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type SomeType { @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md index 1d90810b..04db27cf 100644 --- a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts" /** @gqlType */ type Query = {}; @@ -8,11 +8,13 @@ type Query = {}; export function foo(_: Query): string { return "foo"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts:2:14 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 type Query = {}; ~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md index 8df670a2..eedf0e89 100644 --- a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts" /** @gqlType */ type Query = undefined; @@ -8,11 +8,13 @@ type Query = undefined; export function foo(_: Query): string { return "foo"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts:2:14 - error: Expected `@gqlType` type to be an object type literal (`{ }`) or `unknown`. For example: `type Foo = { bar: string }` or `type Query = unknown`. 2 type Query = undefined; ~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md index 9f998446..7cf6edb4 100644 --- a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/QueryAsAliasOfUnknown.ts" /** @gqlType */ type Query = unknown; @@ -8,10 +8,11 @@ type Query = unknown; export function foo(_: Query): string { return "foo"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type Query { foo: String @@ -39,3 +40,4 @@ export function getSchema(): GraphQLSchema { types: [QueryType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md index 882bb72f..d54e0e23 100644 --- a/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_alias/RenamedType.ts" /** * @gqlType SomeType */ @@ -8,10 +8,11 @@ type MyAlias = { /** @gqlField */ hello: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md index 2124343f..22b8f497 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md @@ -1,15 +1,16 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/InterfaceType.ts" /** @gqlType */ export default interface SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -32,3 +33,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md index 553173e5..3051222d 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts" /** @gqlInterface */ interface Person { /** @gqlField */ @@ -14,10 +14,11 @@ export interface User extends Person { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface Person { name: String @@ -58,3 +59,4 @@ export function getSchema(): GraphQLSchema { types: [PersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md index 983dd0da..1c60df15 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts" /** @gqlInterface */ interface Person { /** @gqlField */ @@ -17,10 +17,11 @@ export interface User { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts:9:4 - error: `@gqlImplements` has been deprecated. Instead use `interface MyType extends MyInterface`. 9 * @gqlImplements Person @@ -31,3 +32,4 @@ src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterf 9 * @gqlImplements Person ~~~~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md index 14eb4cb8..5b9bc527 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/InterfaceTypeImplementsInterface.ts" /** @gqlType */ export default interface User extends HasName { __typename: "User"; @@ -16,10 +16,11 @@ interface HasName { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface HasName { name: String @@ -65,3 +66,4 @@ export function getSchema(): GraphQLSchema { types: [HasNameType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md index 44fe757b..d9203be9 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/InterfaceWithDescription.ts" /** * The root of all evil. * @@ -10,10 +10,11 @@ export default interface SomeType { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type SomeType { @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md index f139fc43..ed166345 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts" /** * The root of all evil. * @@ -10,10 +10,11 @@ export default interface NotQuery { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """The root of all evil.""" type SomeType { @@ -38,3 +39,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md index 6b55fb83..745ae9e0 100644 --- a/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md @@ -1,16 +1,18 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/QueryFromInterface.invalid.ts" /** @gqlType */ export default interface Query { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts:2:26 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 export default interface Query { ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md index a2aae648..91c22d1c 100644 --- a/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/RenamedType.ts" /** * @gqlType SomeType */ @@ -8,10 +8,11 @@ interface MyInterface { /** @gqlField */ hello: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type SomeType { hello: String @@ -34,3 +35,4 @@ export function getSchema(): GraphQLSchema { types: [SomeTypeType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md index 5f35e21b..069d6e79 100644 --- a/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md @@ -1,13 +1,15 @@ ------------------ -INPUT ------------------ +## input + +```ts title="type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts" /** @gqlType */ function MyFunc() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlType` can only be used on class, interface or type declarations. e.g. `class MyType {}` 1 /** @gqlType */ ~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md b/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md index 6a23a5f8..bf927a6c 100644 --- a/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/ImplementorMissingTypename.invalid.ts" /** @gqlType */ class User implements IPerson { /** @gqlField */ @@ -12,10 +12,11 @@ export interface IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts:2:7 - error: Cannot resolve typename. The type `User` implements `IPerson`, so it must either have a `__typename` property or be an exported class. 2 class User implements IPerson { @@ -25,3 +26,4 @@ src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts:2:7 - error: C 8 export interface IPerson { ~~~~~~~ IPerson is defined here: +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md b/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md index 28a7c3a9..28e8e8f5 100644 --- a/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/MethodTypename.invalid.ts" /** @gqlType */ class User { __typename() { @@ -9,11 +9,13 @@ class User { /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/typename/MethodTypename.invalid.ts:3:3 - error: Expected `__typename` to be a property declaration. For example: `__typename: "MyType"`. 3 __typename() { ~~~~~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md index 09932219..228a1df6 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertySignatureTypename.ts" /** @gqlType */ export class User implements IPerson { __typename: "User"; @@ -13,10 +13,11 @@ export interface IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- interface IPerson { name: String @@ -57,3 +58,4 @@ export function getSchema(): GraphQLSchema { types: [IPersonType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md index 9b0ad71e..2a23f3fb 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertySignatureTypenameIncorrectName.invalid.ts" /** @gqlType */ export class User implements IPerson { __typename: "Group"; @@ -13,10 +13,11 @@ export interface IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts:3:15 - error: Expected `__typename` property to be `"User"`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -50,3 +51,4 @@ export interface IPerson { /** @gqlField */ name: string; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md index 224b4016..a84a7b21 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertySignatureTypenameMissingType.invalid.ts" /** @gqlType */ export class User implements IPerson { __typename; @@ -13,10 +13,11 @@ export interface IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts:3:3 - error: Expected `__typename` property to have an initializer or a string literal type. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -50,3 +51,4 @@ export interface IPerson { /** @gqlField */ name: string; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md index 176e1704..580a0346 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertySignatureTypenameNonLiteralType.invalid.ts" /** @gqlType */ export class User implements IPerson { __typename: string; @@ -13,10 +13,11 @@ export interface IPerson { /** @gqlField */ name: string; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts:3:15 - error: Expected `__typename` property signature to specify the typename as a string literal string type. For example `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -50,3 +51,4 @@ export interface IPerson { /** @gqlField */ name: string; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypename.ts.expected.md b/src/tests/fixtures/typename/PropertyTypename.ts.expected.md index 3ebd0ce8..ea9bf142 100644 --- a/src/tests/fixtures/typename/PropertyTypename.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypename.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypename.ts" /** @gqlType */ export class User { __typename = "User" as const; /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- type User { name: String @@ -33,3 +34,4 @@ export function getSchema(): GraphQLSchema { types: [UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md index 34ed324f..2644b783 100644 --- a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypenameDoesNotMatchClassName.invalid.ts" /** @gqlType */ export class User { __typename = "Group" as const; /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts:3:16 - error: Expected `__typename` property initializer to be `"User"`, found `"Group"`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -38,3 +39,4 @@ export class User { /** @gqlField */ name: string = "Alice"; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md index 3a890063..f6a27d3d 100644 --- a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts" /** @gqlType User */ export class UserModel { __typename = "UserModel" as const; /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts:3:16 - error: Expected `__typename` property initializer to be `"User"`, found `"UserModel"`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -38,3 +39,4 @@ export class UserModel { /** @gqlField */ name: string = "Alice"; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md index 0dd41c14..0e2ddf1e 100644 --- a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts" /** @gqlType */ export class User { __typename = "User"; /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts:3:16 - error: Expected `__typename` property initializer to be an expression with a const assertion. For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -38,3 +39,4 @@ export class User { /** @gqlField */ name: string = "Alice"; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md index c835c749..a77d4ed5 100644 --- a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts" /** @gqlType */ export class User { __typename = "User" as Foo; @@ -9,10 +9,11 @@ export class User { } type Foo = string; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts:3:26 - error: Expected `__typename` property type name to be "const". For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -42,3 +43,4 @@ export class User { } type Foo = string; +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md index 32f76fa0..19046b71 100644 --- a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypenameNoInitializer.invalid.ts" /** @gqlType */ export class User { __typename: string; /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts:3:15 - error: Expected `__typename` property signature to specify the typename as a string literal string type. For example `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -38,3 +39,4 @@ export class User { /** @gqlField */ name: string = "Alice"; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md index acf0f3d8..5e406359 100644 --- a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md @@ -1,16 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/PropertyTypenameNonStringInitializer.invalid.ts" /** @gqlType */ export class User { __typename = 1 as const; /** @gqlField */ name: string = "Alice"; } +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts:3:16 - error: Expected `__typename` property initializer to be a string literal. For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -38,3 +39,4 @@ export class User { /** @gqlField */ name: string = "Alice"; } +``` \ No newline at end of file diff --git a/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md b/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md index f836c2c4..729176e7 100644 --- a/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="typename/UnionMemberMissingTypename.invalid.ts" /** @gqlType */ class User { /** @gqlField */ @@ -15,10 +15,11 @@ class Group { /** @gqlUnion */ export type MyUnion = User | Group; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts:8:7 - error: Cannot resolve typename. The type `Group` is a member of `MyUnion`, so it must either have a `__typename` property or be an exported class. 8 class Group { @@ -37,3 +38,4 @@ src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts:2:7 - error: C 14 export type MyUnion = User | Group; ~~~~~~~ MyUnion is defined here: +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md b/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md index 7eebc76f..549043be 100644 --- a/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionOfOneType.ts" /** @gqlType */ class User { __typename = "User" as const; @@ -10,10 +10,11 @@ class User { /** @gqlUnion */ type Actor = User; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union Actor = User @@ -44,3 +45,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionType.ts.expected.md b/src/tests/fixtures/unions/DefineUnionType.ts.expected.md index 47b5ed1f..b33ed265 100644 --- a/src/tests/fixtures/unions/DefineUnionType.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionType.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionType.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -23,10 +23,11 @@ class Entity { /** @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union Actor = Entity | User @@ -87,3 +88,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, EntityType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md index 6da1d821..37d4eb23 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionTypeContainingInterface.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -21,11 +21,13 @@ interface Entity { /** @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts:20:21 - error: Union type Actor can only include Object types, it cannot include Entity. 20 type Actor = User | Entity; ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md index fde8e9a1..ff88fc5a 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionTypeReferencingInputType.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -20,11 +20,13 @@ type Entity = { /** @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts:19:21 - error: Union type Actor can only include Object types, it cannot include Entity. 19 type Actor = User | Entity; ~~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md index db17d41d..cd277623 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionTypeReferencingLiteral.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -15,13 +15,15 @@ class User { /** @gqlUnion */ type Actor = User | "LOL"; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts:14:21 - error: Expected `@gqlUnion` union members to be type references. Grats expects union members to be references to something annotated with `@gqlType`. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. 14 type Actor = User | "LOL"; ~~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md index 7fecbbb1..3c11371e 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionTypeWithInterfaces.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -23,10 +23,11 @@ interface Entity { /** @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union Actor = Entity | User @@ -87,3 +88,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, EntityType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md index 4c1f4dfb..cab2ed5b 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/DefineUnionTypeWithTypeLiterals.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -23,10 +23,11 @@ type Entity = { /** @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- union Actor = Entity | User @@ -87,3 +88,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, EntityType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md index 2370d7dd..08e321b1 100644 --- a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/UnionAsMemberOfItself.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -23,10 +23,11 @@ class Entity { /** @gqlUnion */ type Actor = User | Entity | Actor; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts:9:16 - error: Expected `__typename` property initializer to be an expression with a const assertion. For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. @@ -85,3 +86,4 @@ class Entity { /** @gqlUnion */ type Actor = User | Entity | Actor; +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md b/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md index 8ef73450..2282d486 100644 --- a/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/UnionAsMemberOfOtherUnion.invalid.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -33,11 +33,13 @@ type Foo = User | Entity; /** @gqlUnion */ type Actor = Admin | Foo; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts:32:22 - error: Union type Actor can only include Object types, it cannot include Foo. 32 type Actor = Admin | Foo; ~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md b/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md index 863344b7..1409b5cf 100644 --- a/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md +++ b/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="unions/UnionWithDescription.ts" /** @gqlType */ export default class SomeType { /** @gqlField */ @@ -26,10 +26,11 @@ class Entity { * @gqlUnion */ type Actor = User | Entity; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- SDL -- """One type to rule them all, and in a union bind them.""" union Actor = Entity | User @@ -92,3 +93,4 @@ export function getSchema(): GraphQLSchema { types: [ActorType, EntityType, SomeTypeType, UserType] }); } +``` \ No newline at end of file diff --git a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md index a3becbef..70dc52d6 100644 --- a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="user_error/DuplicateOneOfTag.invalid.ts" /** * @gqlInput * @oneOf @@ -9,10 +9,11 @@ INPUT type Foo = { a: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts:3:4 - error: Unexpected duplicate `@oneOf` tag. Grats does not accept multiple instances of the same tag. @@ -50,3 +51,4 @@ src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts:3:4 - error: Unexpect type Foo = { a: string; }; +``` \ No newline at end of file diff --git a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md index de7a8f7b..47c8fb3e 100644 --- a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md @@ -1,11 +1,12 @@ ------------------ -INPUT ------------------ +## input + +```ts title="user_error/GqlTagDoesNotExist.invalid.ts" /** @gqlFiled */ +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts:1:6 - error: `@gqlFiled` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. @@ -26,3 +27,4 @@ src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts:1:6 - error: `@gqlFi -- Fixed Text -- /** @gqlField */ +``` \ No newline at end of file diff --git a/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md b/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md index 30ad6445..6d586fc6 100644 --- a/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md @@ -1,14 +1,17 @@ ------------------ -INPUT ------------------ +## input + +```ts title="user_error/InvalidSyntax.invalid.ts" /** @gqlType */ class #Foo { } ------------------ -OUTPUT ------------------ +``` + +## Output + +``` src/tests/fixtures/user_error/InvalidSyntax.invalid.ts:2:7 - error TS1005: '{' expected. 2 class #Foo { ~~~~ +``` \ No newline at end of file diff --git a/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md b/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md index 04db36cd..b6733f74 100644 --- a/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="user_error/KillsParentOnExceptionOnNonField.invalid.ts" /** @killsParentOnException */ const foo = "bar"; @@ -9,12 +9,13 @@ type Foo = { /** @gqlField */ bar: string; }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts:1:6 - error: Unexpected `@killsParentOnException`. `@killsParentOnException` can only be used in field annotation docblocks. Perhaps you are missing a `@gqlField` tag? 1 /** @killsParentOnException */ ~~~~~~~~~~~~~~~~~~~~~~ - +``` \ No newline at end of file diff --git a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md index d323015f..f6fb69dc 100644 --- a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md @@ -1,12 +1,13 @@ ------------------ -INPUT ------------------ +## input + +```ts title="user_error/WrongCaseGqlTag.invalid.ts" /** @GQLField */ function field() {} +``` + +## Output ------------------ -OUTPUT ------------------ +``` -- Error Report -- src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts:1:6 - error: Incorrect casing for Grats tag `@GQLField`. Use `@gqlField` instead. @@ -29,3 +30,4 @@ src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts:1:6 - error: Incorrect -- Fixed Text -- /** @gqlField */ function field() {} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md b/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md index 71fa9dec..b84d7654 100644 --- a/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md +++ b/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="aliasedMethod/index.ts" /** @gqlContext */ type GraphqlContext = {}; @@ -27,14 +27,16 @@ export const query = /* GraphQL */ ` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "someType": { "someName": "Hello World!" } } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md b/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md index e8268411..305aa2e8 100644 --- a/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md +++ b/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="complexDefaultInput/index.ts" /** * @gqlInput */ @@ -24,12 +24,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Sup" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md b/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md index 7623c053..b805e5da 100644 --- a/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md +++ b/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="complexPlurals/index.ts" /** @gqlQueryField */ export function arrayOfPromises(): Promise[] { return [ @@ -48,10 +48,11 @@ export const query = ` # asyncIterableOfArrayOfPromises } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "arrayOfPromises": [ @@ -73,4 +74,5 @@ OUTPUT ] ] } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/connectionExample/index.ts.expected.md b/src/tests/integrationFixtures/connectionExample/index.ts.expected.md index 4dd67370..ffde72a2 100644 --- a/src/tests/integrationFixtures/connectionExample/index.ts.expected.md +++ b/src/tests/integrationFixtures/connectionExample/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="connectionExample/index.ts" import { Int } from "../../../Types"; /** @gqlQueryField */ @@ -154,10 +154,11 @@ export const query = gql` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "firstTwo": { @@ -215,4 +216,5 @@ OUTPUT ] } } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md b/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md index 05208552..c6a40c49 100644 --- a/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md +++ b/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="customScalarSerialization/index.ts" import type { SchemaConfig } from "./schema"; /** @gqlScalar */ @@ -57,14 +57,16 @@ export const variables = { someVar: 123, someOtherVar: "456", }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "123", "helloAsWell": "456", "alsoHello": "5" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/deprecated/index.ts.expected.md b/src/tests/integrationFixtures/deprecated/index.ts.expected.md index a58d2b4e..3d042c02 100644 --- a/src/tests/integrationFixtures/deprecated/index.ts.expected.md +++ b/src/tests/integrationFixtures/deprecated/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="deprecated/index.ts" /** * @gqlQueryField * @deprecated For reasons @@ -22,12 +22,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Hello World" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/derivedContext/index.ts.expected.md b/src/tests/integrationFixtures/derivedContext/index.ts.expected.md index d12f3887..1a072b35 100644 --- a/src/tests/integrationFixtures/derivedContext/index.ts.expected.md +++ b/src/tests/integrationFixtures/derivedContext/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="derivedContext/index.ts" /** @gqlContext */ type Ctx = {}; @@ -21,12 +21,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Hello Roger" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/enumDefault/index.ts.expected.md b/src/tests/integrationFixtures/enumDefault/index.ts.expected.md index 50295e7e..bf7996cb 100644 --- a/src/tests/integrationFixtures/enumDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/enumDefault/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enumDefault/index.ts" // https://github.com/captbaritone/grats/issues/172#issuecomment-2685496600 /** @gqlEnum */ @@ -16,12 +16,14 @@ export const query = /* GraphQL */ ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Greetings World" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/enumExport/index.ts.expected.md b/src/tests/integrationFixtures/enumExport/index.ts.expected.md index 825e0144..2eb1a31e 100644 --- a/src/tests/integrationFixtures/enumExport/index.ts.expected.md +++ b/src/tests/integrationFixtures/enumExport/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="enumExport/index.ts" // {"tsClientEnums": "enums.ts"} /** @gqlEnum */ @@ -48,14 +48,16 @@ export const query = /* GraphQL */ ` colorName(color: red) } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "favoriteColor": "red", "currentPriority": "medium", "colorName": "Red" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md b/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md index d602372f..1395ab45 100644 --- a/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="explicitNullPassedToArgWithDefault/index.ts" /** * Validating what graphql-js does when an explicit null is passed to an argument * with a default value. @@ -27,12 +27,14 @@ export const query = ` hello(someArg: null) } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "got null" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/functionField/index.ts.expected.md b/src/tests/integrationFixtures/functionField/index.ts.expected.md index 1d73186b..0d84ed34 100644 --- a/src/tests/integrationFixtures/functionField/index.ts.expected.md +++ b/src/tests/integrationFixtures/functionField/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="functionField/index.ts" /** @gqlQueryField */ export function hello(): string { return "Hello World"; @@ -11,12 +11,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Hello World" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md b/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md index 12bad7fc..e4175083 100644 --- a/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md +++ b/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="functionFieldRenamed/index.ts" /** @gqlQueryField hello */ export function notHello(): string { return "Hello World"; @@ -11,12 +11,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Hello World" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/getAcessor/index.ts.expected.md b/src/tests/integrationFixtures/getAcessor/index.ts.expected.md index 12c242e2..555c32d4 100644 --- a/src/tests/integrationFixtures/getAcessor/index.ts.expected.md +++ b/src/tests/integrationFixtures/getAcessor/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="getAcessor/index.ts" /** @gqlQueryField */ export function me(): User { return new User(); @@ -20,14 +20,16 @@ export const query = ` hello } }`; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "me": { "hello": "Hello world!" } } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md b/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md index 95b513d9..113389a7 100644 --- a/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md +++ b/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="inputTypeOneOf/index.ts" import { ID } from "../../.."; /** @gqlInput */ @@ -36,12 +36,14 @@ export const query = ` greet(greeting: { name: "Alice" }) } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "greet": "Hello, Alice!" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md b/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md index fe2d1029..990a5b39 100644 --- a/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md +++ b/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="killsParentOnException/index.ts" /** @gqlQueryField */ export function me(): User { return new User(); @@ -24,10 +24,11 @@ export const query = ` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "errors": [ { @@ -47,4 +48,5 @@ OUTPUT "data": { "me": null } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md b/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md index 1654d3a7..53d53403 100644 --- a/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md +++ b/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="killsParentOnExceptionOnQuery/index.ts" /** * @gqlQueryField * @killsParentOnException @@ -20,10 +20,11 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "errors": [ { @@ -40,4 +41,5 @@ OUTPUT } ], "data": null -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md b/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md index e0ae9a8c..d6efd12d 100644 --- a/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md +++ b/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="killsParentOnExceptionReturnsNull/index.ts" /** @gqlQueryField */ export function me(): User { return new User(); @@ -25,10 +25,11 @@ export const query = ` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "errors": [ { @@ -48,4 +49,5 @@ OUTPUT "data": { "me": null } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md b/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md index be117a2f..fcb05c03 100644 --- a/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="nonNullArgWithDefault/index.ts" /** @gqlQueryField */ export function hello({ greeting = "Hello" }: { greeting: string }): string { return `${greeting}, world!`; @@ -11,12 +11,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Hello, world!" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md b/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md index 137d10d5..2a54c2ce 100644 --- a/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="nonNullEnumDefault/index.ts" // https://github.com/captbaritone/grats/issues/174 /** @gqlEnum */ @@ -16,12 +16,14 @@ export const query = /* GraphQL */ ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Greetings World" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md b/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md index 66bea10a..1652ca76 100644 --- a/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md +++ b/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="nonNullableListIncludesNull/index.ts" /** @gqlQueryField */ export function someList(): string[] { // @ts-ignore @@ -19,10 +19,11 @@ export const query = ` someListOfLists } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "errors": [ { @@ -57,4 +58,5 @@ OUTPUT "someList": null, "someListOfLists": null } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/numericID/index.ts.expected.md b/src/tests/integrationFixtures/numericID/index.ts.expected.md index eed9fbba..0f5ca3ad 100644 --- a/src/tests/integrationFixtures/numericID/index.ts.expected.md +++ b/src/tests/integrationFixtures/numericID/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="numericID/index.ts" import { ID } from "../../../Types"; /** @@ -27,12 +27,14 @@ export const query = /* GraphQL */ ` export const variables = { someID: 123, }; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "123" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md b/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md index 8ae15ad7..a5525656 100644 --- a/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md +++ b/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="parameterPropertyRenamed/index.ts" /** @gqlQueryField */ export function me(): User { return new User(); @@ -21,14 +21,16 @@ export const query = ` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "me": { "hello": "world" } } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md b/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md index 07436fe1..d453c5f9 100644 --- a/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="positionalNonNullArgWithDefault/index.ts" /** @gqlQueryField */ export function hello(greeting: string = "Hello"): string { return `${greeting}, world!`; @@ -11,12 +11,14 @@ export const query = ` hello } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "hello": "Hello, world!" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md b/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md index 16c3c427..7e329652 100644 --- a/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md +++ b/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="promiseOfPromise/index.ts" /** @gqlQueryField */ export function promiseOfPromise(): Promise> { return promiseOf(promiseOf("Hello world!")); @@ -22,13 +22,15 @@ export const query = ` promiseOfPromise promiseOfPromisePromise }`; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "promiseOfPromise": "Hello world!", "promiseOfPromisePromise": "Hello world!" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md b/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md index 28c80e50..7ac94f76 100644 --- a/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md +++ b/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolveTypeViaClass/index.ts" import { ID } from "../../../Types"; /** @gqlInterface */ @@ -84,10 +84,11 @@ export const query = /* GraphQL */ ` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "user": { @@ -106,4 +107,5 @@ OUTPUT "__typename": "RenamedNode" } } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md b/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md index b2705c65..4a19fe66 100644 --- a/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md +++ b/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="resolverErrorElidedToNull/index.ts" /** @gqlQueryField */ export function alwaysThrows(): string { throw new Error("This should null out the field"); @@ -11,10 +11,11 @@ export const query = ` alwaysThrows } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "errors": [ { @@ -33,4 +34,5 @@ OUTPUT "data": { "alwaysThrows": null } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/skipInclude/index.ts.expected.md b/src/tests/integrationFixtures/skipInclude/index.ts.expected.md index 1b0a0b85..dd83f942 100644 --- a/src/tests/integrationFixtures/skipInclude/index.ts.expected.md +++ b/src/tests/integrationFixtures/skipInclude/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="skipInclude/index.ts" /** @gqlQueryField */ export function greeting(): string { return "Hello World!"; @@ -16,12 +16,14 @@ export const query = /* GraphQL */ ` greeting @include(if: true) } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "data": { "greeting": "Hello World!" } -} \ No newline at end of file +} +``` \ No newline at end of file diff --git a/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md b/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md index b08959e9..e3701408 100644 --- a/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md +++ b/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md @@ -1,6 +1,6 @@ ------------------ -INPUT ------------------ +## input + +```ts title="strictSemanticNullability/index.ts" // { "strictSemanticNullability": true } /** @gqlQueryField */ @@ -58,10 +58,11 @@ export const query = ` } } `; +``` + +## Output ------------------ -OUTPUT ------------------ +``` { "errors": [ { @@ -123,4 +124,5 @@ OUTPUT "notName": null } } -} \ No newline at end of file +} +``` \ No newline at end of file From 94813e819301dc1dacc182c19c4611ba95f431cd Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 9 Dec 2025 22:26:23 -0800 Subject: [PATCH 3/6] Format some errors and code actions as markdown in snapshots --- src/tests/TestRunner.ts | 19 ++++---- ...eferencesNonGqlType.invalid.ts.expected.md | 4 +- .../ArgWithNoType.invalid.ts.expected.md | 4 +- ...yncIterableArgument.invalid.ts.expected.md | 4 +- ...tedRequiredArgument.invalid.ts.expected.md | 4 +- ...sTypedAsTypeLiteral.invalid.ts.expected.md | 4 +- .../NoArgsWithNever.invalid.ts.expected.md | 4 +- .../NoArgsWithUnknown.invalid.ts.expected.md | 4 +- .../NoTypeAnnotation.invalid.ts.expected.md | 4 +- ...lableArgumentErrors.invalid.ts.expected.md | 33 +++++++++---- ...jectLiteralArgument.invalid.ts.expected.md | 4 +- .../OpaqueArgType.invalid.ts.expected.md | 4 +- ...NonNullableArgument.invalid.ts.expected.md | 21 ++++++--- ...ositionalArgAndArgs.invalid.ts.expected.md | 4 +- ...OptionalNotNullable.invalid.ts.expected.md | 21 ++++++--- .../PromiseArgument.invalid.ts.expected.md | 4 +- ...upleLiteralArgument.invalid.ts.expected.md | 4 +- ...entFollowsDecorator.invalid.ts.expected.md | 4 +- ...etachedBlockComment.invalid.ts.expected.md | 4 +- ...NotJSDocWithoutStar.invalid.ts.expected.md | 21 ++++++--- ...tWithInvalidTagName.invalid.ts.expected.md | 4 +- ...mentWithKillsParent.invalid.ts.expected.md | 4 +- ...kCommentWithoutStar.invalid.ts.expected.md | 4 +- ...lidTagInLinecomment.invalid.ts.expected.md | 21 ++++++--- .../lineComment.invalid.ts.expected.md | 27 ++++++++--- ...eCommentWrongCasing.invalid.ts.expected.md | 27 ++++++++--- ...onJSDocBlockComment.invalid.ts.expected.md | 21 ++++++--- ...erIsArrayWithNumber.invalid.ts.expected.md | 4 +- .../invalidKey.invalid.ts.expected.md | 4 +- ...multipleInvalidKeys.invalid.ts.expected.md | 4 +- .../nonNullableIsNull.invalid.ts.expected.md | 4 +- ...ByMissingUrlinvalid.invalid.ts.expected.md | 4 +- ...pecifiedByOldSyntax.invalid.ts.expected.md | 21 ++++++--- .../SpecifiedByOnEnum.invalid.ts.expected.md | 4 +- ...AttachedToWrongNode.invalid.ts.expected.md | 4 +- ...tArrayValuesInvalid.invalid.ts.expected.md | 4 +- ...DynamicPropertyName.invalid.ts.expected.md | 4 +- ...iteralInterpolation.invalid.ts.expected.md | 4 +- ...tiplePropertyErrors.invalid.ts.expected.md | 4 +- ...ObjectLiteralSpread.invalid.ts.expected.md | 4 +- ...ckticksInterpolated.invalid.ts.expected.md | 4 +- ...LiteralDefaultValue.invalid.ts.expected.md | 4 +- ...icContextDependency.invalid.ts.expected.md | 4 +- ...DependencyWithChain.invalid.ts.expected.md | 4 +- ...derivedContextChain.invalid.ts.expected.md | 4 +- ...ContextNoReturnType.invalid.ts.expected.md | 4 +- ...tNonNamedReturnType.invalid.ts.expected.md | 4 +- ...vedContextsSameType.invalid.ts.expected.md | 4 +- ...textReadsRandomType.invalid.ts.expected.md | 4 +- ...ontextUndefinedType.invalid.ts.expected.md | 4 +- ...ptionFollowsTypeTag.invalid.ts.expected.md | 4 +- ...tionOnLineOfTypeTag.invalid.ts.expected.md | 4 +- ...llowedByDescription.invalid.ts.expected.md | 4 +- ...tiveLocationInvalid.invalid.ts.expected.md | 4 +- ...DirectiveNoLocation.invalid.ts.expected.md | 4 +- ...ectiveOnIsNotString.invalid.ts.expected.md | 4 +- ...rectiveReadsContext.invalid.ts.expected.md | 4 +- ...tiveArgFieldInvalid.invalid.ts.expected.md | 4 +- ...tiveArgInvalidOneOf.invalid.ts.expected.md | 4 +- .../directiveNotConst.invalid.ts.expected.md | 4 +- ...UsedWithInvalidArgs.invalid.ts.expected.md | 4 +- ...tiveWithSyntaxError.invalid.ts.expected.md | 4 +- ...edDirectiveWithArgs.invalid.ts.expected.md | 4 +- ...UnionTypeNotLiteral.invalid.ts.expected.md | 4 +- ...ypeNotStringLiteral.invalid.ts.expected.md | 4 +- ...WithEmitEnumsConfig.invalid.ts.expected.md | 21 ++++++--- ...mNotValidIdentifier.invalid.ts.expected.md | 4 +- ...plicitlyNumericEnum.invalid.ts.expected.md | 4 +- ...WithEmitEnumsConfig.invalid.ts.expected.md | 4 +- ...plicitlyNumericEnum.invalid.ts.expected.md | 4 +- ...llowedWithEmitEnums.invalid.ts.expected.md | 4 +- ...ddStringFieldToEnum.invalid.ts.expected.md | 4 +- ...eldToInterfaceTwice.invalid.ts.expected.md | 4 +- ...ringFieldToNonGrats.invalid.ts.expected.md | 4 +- ...xistsOnConcreteType.invalid.ts.expected.md | 4 +- ...plementingInterface.invalid.ts.expected.md | 4 +- ...dAsArrowFunctionLet.invalid.ts.expected.md | 4 +- ...FunctionNotExported.invalid.ts.expected.md | 21 ++++++--- ...dAsArrowFunctionVar.invalid.ts.expected.md | 4 +- ...edMultipleVariables.invalid.ts.expected.md | 4 +- ...ldAsExportedNothing.invalid.ts.expected.md | 4 +- ...eldAsExportedNumber.invalid.ts.expected.md | 4 +- ...issingFirstArgument.invalid.ts.expected.md | 4 +- ...ngFirstArgumentType.invalid.ts.expected.md | 4 +- ...asFirstArgumentType.invalid.ts.expected.md | 4 +- ...QLFirstArgumentType.invalid.ts.expected.md | 4 +- .../notExported.invalid.ts.expected.md | 21 ++++++--- .../FieldAsSetter.invalid.ts.expected.md | 4 +- ...MethodInNestedScope.invalid.ts.expected.md | 4 +- ...tedScopeButExported.invalid.ts.expected.md | 4 +- ...ssMethodNotExported.invalid.ts.expected.md | 22 ++++++--- ...DefinedOnNonGqlType.invalid.ts.expected.md | 4 +- ...eldOnArbitraryParam.invalid.ts.expected.md | 4 +- ...dTagOnIncorrectNode.invalid.ts.expected.md | 4 +- ...nionOfMultipleTypes.invalid.ts.expected.md | 4 +- ...hodFieldMissingType.invalid.ts.expected.md | 4 +- ...FieldBindingPattern.invalid.ts.expected.md | 4 +- ...ertyFieldNoModifier.invalid.ts.expected.md | 21 ++++++--- ...PropertyFieldNoType.invalid.ts.expected.md | 4 +- ...ieldReadOnlyPrivate.invalid.ts.expected.md | 21 ++++++--- ...otectedFieldMethods.invalid.ts.expected.md | 4 +- ...rtyFieldMissingType.invalid.ts.expected.md | 4 +- ...renceNonGraphQLType.invalid.ts.expected.md | 4 +- ...erenceUndefinedType.invalid.ts.expected.md | 4 +- ...ionFieldNotExported.invalid.ts.expected.md | 21 ++++++--- .../DuplicateFields.invalid.ts.expected.md | 4 +- ...esNotMatchInterface.invalid.ts.expected.md | 4 +- ...lsParentOnException.invalid.ts.expected.md | 4 +- ...bleByDefaultEnables.invalid.ts.expected.md | 4 +- ...rrayPassedToGeneric.invalid.ts.expected.md | 4 +- .../enumWithGeneric.invalid.ts.expected.md | 4 +- ...peUsedAsUnionMember.invalid.ts.expected.md | 4 +- ...nMemberViaTypeParam.invalid.ts.expected.md | 4 +- ...ngGqlGenericTypeArg.invalid.ts.expected.md | 4 +- ...peToInputType.input.invalid.ts.expected.md | 4 +- ...encingMethodGeneric.invalid.ts.expected.md | 4 +- ...rPassedAsGenericArg.invalid.ts.expected.md | 4 +- ...erfaceFromTypeParam.invalid.ts.expected.md | 4 +- ...ImplementsInterface.invalid.ts.expected.md | 4 +- ...sedAsGenericTypeArg.invalid.ts.expected.md | 4 +- .../oneOfDeprecated.invalid.ts.expected.md | 4 +- ...ssingTypeAnnotation.invalid.ts.expected.md | 4 +- ...FieldTypeNotGraphQL.invalid.ts.expected.md | 4 +- ...erHasMultipleFields.invalid.ts.expected.md | 4 +- ...eOfMemberHasNoField.invalid.ts.expected.md | 4 +- ...ionMemberNotLiteral.invalid.ts.expected.md | 4 +- ...eOneOfDeprecatedTag.invalid.ts.expected.md | 21 ++++++--- ...ferencedInInputType.invalid.ts.expected.md | 4 +- ...DeprecatedInputType.invalid.ts.expected.md | 4 +- ...peInterfaceFunction.invalid.ts.expected.md | 4 +- ...TypeInterfaceMethod.invalid.ts.expected.md | 4 +- ...terfacePromiseField.invalid.ts.expected.md | 4 +- ...TypeMergedInterface.invalid.ts.expected.md | 4 +- ...ferencingOutputType.invalid.ts.expected.md | 4 +- ...peReturnedFromField.invalid.ts.expected.md | 4 +- ...ecatedRequiredField.invalid.ts.expected.md | 4 +- ...utFieldWithGqlField.invalid.ts.expected.md | 21 ++++++--- ...faceMergedIntoClass.invalid.ts.expected.md | 4 +- ...erfaceMissingFields.invalid.ts.expected.md | 4 +- .../MergedInterfaces.invalid.ts.expected.md | 4 +- ...AttachedToWrongNode.invalid.ts.expected.md | 4 +- ...houtTypeOrInterface.invalid.ts.expected.md | 4 +- ...ntextValueInArgsPos.invalid.ts.expected.md | 4 +- ...ssingTypeAnnotation.invalid.ts.expected.md | 4 +- .../ContextValueSpread.invalid.ts.expected.md | 4 +- ...ValueTypeNotDefined.invalid.ts.expected.md | 4 +- ...textValueTypedAsAny.invalid.ts.expected.md | 4 +- ...xtValueTypedAsNever.invalid.ts.expected.md | 4 +- ...ValueTypedAsUnknown.invalid.ts.expected.md | 4 +- ...leContextValuesUsed.invalid.ts.expected.md | 4 +- ...esNotMatchInterface.invalid.ts.expected.md | 4 +- ...esNotMatchInterface.invalid.ts.expected.md | 4 +- ...peWithAsyncIterable.invalid.ts.expected.md | 4 +- ...ssWithAsyncIterable.invalid.ts.expected.md | 4 +- .../queryFieldOnMethod.invalid.ts.expected.md | 4 +- ...hFirstArgParentType.invalid.ts.expected.md | 4 +- ...eldNotAsyncIterable.invalid.ts.expected.md | 4 +- .../ClassMissingFields.invalid.ts.expected.md | 4 +- .../ClassWithoutAName.invalid.ts.expected.md | 4 +- .../QueryAsClass.invalid.ts.expected.md | 4 +- .../RenamedTypeHasDash.invalid.ts.expected.md | 4 +- .../RenamedTypeNewLine.invalid.ts.expected.md | 4 +- ...ypeStartsWithNumber.invalid.ts.expected.md | 4 +- ...ypeWithoutClassName.invalid.ts.expected.md | 4 +- ...AttachedToWrongNode.invalid.ts.expected.md | 4 +- ...ceWithDeprecatedTag.invalid.ts.expected.md | 4 +- ...asIsArrayNotLiteral.invalid.ts.expected.md | 4 +- ...sIsNumberNotLiteral.invalid.ts.expected.md | 4 +- ...ImplementsInterface.invalid.ts.expected.md | 4 +- ...ueryAsAliasOfObject.invalid.ts.expected.md | 4 +- ...yAsAliasOfUndefined.invalid.ts.expected.md | 4 +- ...ceWithDeprecatedTag.invalid.ts.expected.md | 4 +- .../QueryFromInterface.invalid.ts.expected.md | 4 +- ...AttachedToWrongNode.invalid.ts.expected.md | 4 +- ...ntorMissingTypename.invalid.ts.expected.md | 4 +- .../MethodTypename.invalid.ts.expected.md | 4 +- ...penameIncorrectName.invalid.ts.expected.md | 21 ++++++--- ...TypenameMissingType.invalid.ts.expected.md | 21 ++++++--- ...enameNonLiteralType.invalid.ts.expected.md | 21 ++++++--- ...esNotMatchClassName.invalid.ts.expected.md | 21 ++++++--- ...otMatchDeclaredName.invalid.ts.expected.md | 21 ++++++--- ...ToBeDeclaredAsConst.invalid.ts.expected.md | 21 ++++++--- ...laredAsExactlyConst.invalid.ts.expected.md | 21 ++++++--- ...penameNoInitializer.invalid.ts.expected.md | 21 ++++++--- ...onStringInitializer.invalid.ts.expected.md | 21 ++++++--- ...mberMissingTypename.invalid.ts.expected.md | 4 +- ...ContainingInterface.invalid.ts.expected.md | 4 +- ...eferencingInputType.invalid.ts.expected.md | 4 +- ...eReferencingLiteral.invalid.ts.expected.md | 4 +- ...ionAsMemberOfItself.invalid.ts.expected.md | 27 ++++++++--- ...sMemberOfOtherUnion.invalid.ts.expected.md | 4 +- .../DuplicateOneOfTag.invalid.ts.expected.md | 22 ++++++--- .../GqlTagDoesNotExist.invalid.ts.expected.md | 20 +++++--- .../InvalidSyntax.invalid.ts.expected.md | 4 +- ...ExceptionOnNonField.invalid.ts.expected.md | 4 +- .../WrongCaseGqlTag.invalid.ts.expected.md | 21 ++++++--- src/tests/test.ts | 46 ++++++++++++------- 197 files changed, 1023 insertions(+), 380 deletions(-) diff --git a/src/tests/TestRunner.ts b/src/tests/TestRunner.ts index 01bb1c86..6904e356 100644 --- a/src/tests/TestRunner.ts +++ b/src/tests/TestRunner.ts @@ -5,10 +5,12 @@ import { ask } from "./yesNo"; import { Result } from "../utils/Result"; import { Markdown } from "./Markdown"; -type Transformer = ( +export type TransformerResult = Result | false; + +export type Transformer = ( code: string, - filename: string, -) => Promise | false> | (Result | false); + fileName: string, +) => TransformerResult | Promise; /** * Looks in a fixtures dir for .ts files, transforms them according to the @@ -123,7 +125,11 @@ export default class TestRunner { output.addHeader(2, "input"); output.addCodeBlock(fixtureContent, fileType, fixture); output.addHeader(2, "Output"); - output.addCodeBlock(actualOutput, ""); + if (actualOutput instanceof Markdown) { + output.addMarkdown(actualOutput); + } else { + output.addCodeBlock(actualOutput, ""); + } const testOutput = output.toString(); @@ -179,10 +185,7 @@ export default class TestRunner { } } - async transform( - code: string, - filename: string, - ): Promise | false> { + async transform(code: string, filename: string): Promise { try { return await this._transformer(code, filename); } catch (e) { diff --git a/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md b/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md index ddf64f9f..8ae1a943 100644 --- a/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts.expected.md @@ -14,7 +14,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/ArgReferencesNonGqlType.invalid.ts:6:35 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 6 hello({ greeting }: { greeting: NotGraphql }): string { diff --git a/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md b/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md index b4eaf3f4..96f03bee 100644 --- a/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/ArgWithNoType.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/ArgWithNoType.invalid.ts:4:25 - error: Expected GraphQL field argument to have an explicit type annotation. For example: `{ someField: string }`. Grats needs to be able to see the type of the arguments to generate a GraphQL schema. 4 hello({ greeting }: { greeting }): string { diff --git a/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md index e68e1bdb..4a655b46 100644 --- a/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/AsyncIterableArgument.invalid.ts:4:27 - error: `AsyncIterable` is not a valid as an input type. 4 hello(args: { greeting: AsyncIterable }): string { diff --git a/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md index e1536f71..5a061708 100644 --- a/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts.expected.md @@ -17,7 +17,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/DeprecatedRequiredArgument.invalid.ts:7:10 - error: Required argument SomeType.hello(greeting:) cannot be deprecated. 7 /** @deprecated Not used anymore */ diff --git a/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md b/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md index 549d8e50..c4bb5193 100644 --- a/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/MultipleParamsTypedAsTypeLiteral.invalid.ts:4:37 - error: Unexpected multiple resolver parameters typed with an object literal. Grats assumes a resolver parameter typed with object literals describes the GraphQL arguments. Therefore only one such parameter is permitted. 4 hello(args: { greeting: string }, alsoArgs: { farewell: string }): string { diff --git a/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md b/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md index 5b020bf4..04b33f2a 100644 --- a/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts.expected.md @@ -13,7 +13,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/NoArgsWithNever.invalid.ts:4:15 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md b/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md index 27d96a2e..00289071 100644 --- a/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts.expected.md @@ -13,7 +13,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/NoArgsWithUnknown.invalid.ts:4:15 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md b/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md index 42896970..e7e95236 100644 --- a/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/NoTypeAnnotation.invalid.ts:4:9 - error: Missing type annotation for resolver argument. Expected all resolver arguments to have an explicit type annotation. Grats needs to be able to see the type of the arguments to generate an executable GraphQL schema. 4 hello(args): string { diff --git a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md index b56fcd89..ec7d31ac 100644 --- a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md @@ -25,8 +25,9 @@ export default class SomeType { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:4:26 - error: Expected nullable argument to _also_ be optional (`?`). graphql-js may omit properties on the argument object where an undefined GraphQL variable is passed, or if the argument is omitted in the operation text. To ensure your resolver is capable of handling this scenario, add a `?` to the end of the argument name to make it optional. e.g. `{greeting?: string | null}` 4 hello1({ greeting }: { greeting: string | null }): string { @@ -41,9 +42,11 @@ src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:12:26 - error: Ex 12 hello3({ greeting }: { greeting: string | undefined }): string { ~~~~~~~~ +``` +#### Code Action: "Make argument optional" (add-question-token-to-arg) --- Code Action: "Make argument optional" (add-question-token-to-arg) -- +```diff - Original + Fixed @@ -52,7 +55,11 @@ src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:12:26 - error: Ex - hello1({ greeting }: { greeting: string | null }): string { + hello1({ greeting }: { greeting?: string | null }): string { return "Hello world!"; --- Code Action: "Make argument optional" (add-question-token-to-arg) -- +``` + +#### Code Action: "Make argument optional" (add-question-token-to-arg) + +```diff - Original + Fixed @@ -61,7 +68,11 @@ src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:12:26 - error: Ex - hello2({ greeting }: { greeting: string | void }): string { + hello2({ greeting }: { greeting?: string | void }): string { return "Hello world!"; --- Code Action: "Make argument optional" (add-question-token-to-arg) -- +``` + +#### Code Action: "Make argument optional" (add-question-token-to-arg) + +```diff - Original + Fixed @@ -70,13 +81,19 @@ src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:12:26 - error: Ex - hello3({ greeting }: { greeting: string | undefined }): string { + hello3({ greeting }: { greeting?: string | undefined }): string { return "Hello world!"; +``` --- Applied Fixes -- - * Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts +#### Applied Fixes + +```text +* Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts * Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts * Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts +``` + +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export default class SomeType { /** @gqlField */ diff --git a/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md index 9dbcebc2..b1509d50 100644 --- a/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/ObjectLiteralArgument.invalid.ts:4:35 - error: Unexpected type literal. Grats expects types in GraphQL positions to be scalar types, or reference a named GraphQL type directly. You may want to define a named GraphQL type elsewhere and reference it here. 4 hello({ greeting }: { greeting: { foo: string; bar: string } }): string { diff --git a/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md b/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md index 7c92b908..ab9e3b51 100644 --- a/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/OpaqueArgType.invalid.ts.expected.md @@ -14,7 +14,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/OpaqueArgType.invalid.ts:6:23 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 6 hello({ greeting }: SomeType): string { diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md index 4dd9b9b0..0e3caf38 100644 --- a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md @@ -12,15 +12,18 @@ export default class SomeType { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts:4:33 - error: Unexpected optional argument that does not also accept `null`. Optional arguments in GraphQL may get passed an explicit `null` value by the GraphQL executor. This means optional arguments must be typed to also accept `null`. Consider adding `| null` to the end of the argument type. 4 hello({ greeting }: { greeting?: string }): string { ~ +``` +#### Code Action: "Add '| null' to the type" (add-null-to-optional-type) --- Code Action: "Add '| null' to the type" (add-null-to-optional-type) -- +```diff - Original + Fixed @@ -29,11 +32,17 @@ src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts:4:33 - error - hello({ greeting }: { greeting?: string }): string { + hello({ greeting }: { greeting?: string | null }): string { return `${greeting ?? "Hello"} World!`; +``` + +#### Applied Fixes + +```text +* Applied fix "Add '| null' to the type" in grats/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add '| null' to the type" in grats/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export default class SomeType { /** @gqlField */ diff --git a/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md index dd86d7fc..c30b1b0c 100644 --- a/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts.expected.md @@ -18,7 +18,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/PositionalArgAndArgs.invalid.ts:10:29 - error: Unexpected arguments object in resolver that is also using positional GraphQL arguments. Grats expects that either all GraphQL arguments will be defined in a single object, or that all GraphQL arguments will be defined using positional arguments. The two strategies may not be combined. 10 hello(greeting: Greeting, args: { notGreeting: string }): string { diff --git a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md index 53d487cc..1fffa710 100644 --- a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md @@ -18,15 +18,18 @@ export default class SomeType { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts:10:17 - error: Unexpected optional argument that does not also accept `null`. Optional arguments in GraphQL may get passed an explicit `null` value by the GraphQL executor. This means optional arguments must be typed to also accept `null`. Consider adding `| null` to the end of the argument type. 10 hello(greeting?: string): string { ~ +``` +#### Code Action: "Add '| null' to the parameter type" (add-null-to-optional-parameter-type) --- Code Action: "Add '| null' to the parameter type" (add-null-to-optional-parameter-type) -- +```diff - Original + Fixed @@ -35,11 +38,17 @@ src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts:10:17 - - hello(greeting?: string): string { + hello(greeting?: string | null): string { return `${greeting ?? "Hello"} World`; +``` + +#### Applied Fixes + +```text +* Applied fix "Add '| null' to the parameter type" in grats/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add '| null' to the parameter type" in grats/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlInput */ type Greeting = { name: string; diff --git a/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md index 52365976..722898f4 100644 --- a/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PromiseArgument.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/PromiseArgument.invalid.ts:4:27 - error: `Promise` is not a valid as an input type. 4 hello(args: { greeting: Promise }): string { diff --git a/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md index d4a01520..c1b5bae9 100644 --- a/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/arguments/TupleLiteralArgument.invalid.ts:4:35 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md b/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md index 1a68c629..bf2a17bc 100644 --- a/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts.expected.md @@ -14,7 +14,9 @@ export default class Composer { ## Output -``` +### Error Report + +```text src/tests/fixtures/comments/commentFollowsDecorator.invalid.ts:2:5 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 /** @gqlType */ diff --git a/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md index d10a4823..8e187cf0 100644 --- a/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockComment.invalid.ts.expected.md @@ -11,7 +11,9 @@ ## Output -``` +### Error Report + +```text src/tests/fixtures/comments/detachedBlockComment.invalid.ts:2:4 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 * @gqlType diff --git a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md index 567616ad..3f2a4219 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md @@ -11,15 +11,18 @@ ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts:2:4 - error: Unexpected Grats tag in non-JSDoc-style block comment. Grats only looks for tags in JSDoc-style block comments which start with `/**`. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 @gqlType ~~~~~~~~ +``` +#### Code Action: "Convert to a docblock comment" (convert-block-comment-to-docblock-comment) --- Code Action: "Convert to a docblock comment" (convert-block-comment-to-docblock-comment) -- +```diff - Original + Fixed @@ -27,11 +30,17 @@ src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts:2 - /* + /** @gqlType +``` + +#### Applied Fixes + +```text +* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md index 91607ae1..254180b4 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts.expected.md @@ -11,7 +11,9 @@ ## Output -``` +### Error Report + +```text src/tests/fixtures/comments/detachedBlockCommentWithInvalidTagName.invalid.ts:2:4 - error: `@gqlTyp` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. 2 * @gqlTyp diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md index a377fe02..8d14ba68 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts.expected.md @@ -11,7 +11,9 @@ ## Output -``` +### Error Report + +```text src/tests/fixtures/comments/detachedBlockCommentWithKillsParent.invalid.ts:2:4 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 * @killsParentOnException diff --git a/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md index 70fc219e..335cdb02 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts.expected.md @@ -11,7 +11,9 @@ ## Output -``` +### Error Report + +```text src/tests/fixtures/comments/detachedBlockCommentWithoutStar.invalid.ts:2:4 - error: Unexpected Grats tag in detached docblock. Grats was unable to determine which TypeScript declaration this docblock is associated with. Moving the docblock to a position that is unambiguously "above" the relevant declaration may help. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 2 @gqlType diff --git a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md index 14608419..e07d915c 100644 --- a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md @@ -11,8 +11,9 @@ export default class Composer { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts:1:4 - error: `@gqlTyp` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. 1 // @gqlTyp @@ -21,9 +22,11 @@ src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts:1:4 - error: Unex 1 // @gqlTyp ~~~~~~~ +``` +#### Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) --- Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) -- +```diff - Original + Fixed @@ -31,11 +34,17 @@ src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts:1:4 - error: Unex - // @gqlTyp + /** @gqlTyp */ export default class Composer { +``` + +#### Applied Fixes + +```text +* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlTyp */ export default class Composer { url(): string { diff --git a/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md index 938bd38a..94b45751 100644 --- a/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md @@ -12,8 +12,9 @@ export default class Composer { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/comments/lineComment.invalid.ts:1:4 - error: Unexpected Grats tag in line (`//`) comment. Grats looks for tags in JSDoc-style block comments. e.g. `/** @gqlType */`. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 1 // @gqlType @@ -23,9 +24,11 @@ src/tests/fixtures/comments/lineComment.invalid.ts:3:6 - error: Unexpected Grats 3 // @gqlField ~~~~~~~~~ +``` +#### Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) --- Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) -- +```diff - Original + Fixed @@ -33,7 +36,11 @@ src/tests/fixtures/comments/lineComment.invalid.ts:3:6 - error: Unexpected Grats - // @gqlType + /** @gqlType */ export default class Composer { --- Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) -- +``` + +#### Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) + +```diff - Original + Fixed @@ -42,12 +49,18 @@ src/tests/fixtures/comments/lineComment.invalid.ts:3:6 - error: Unexpected Grats - // @gqlField + /** @gqlField */ url(): string { +``` --- Applied Fixes -- - * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineComment.invalid.ts +#### Applied Fixes + +```text +* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineComment.invalid.ts * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineComment.invalid.ts +``` + +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export default class Composer { /** @gqlField */ diff --git a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md index 56096a46..429a15df 100644 --- a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md @@ -12,8 +12,9 @@ export default class Composer { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts:1:4 - error: `@GQLtYPE` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. 1 // @GQLtYPE @@ -31,9 +32,11 @@ src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts:3:6 - error: Unexp 3 // @gqlfield ~~~~~~~~~ +``` +#### Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) --- Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) -- +```diff - Original + Fixed @@ -41,7 +44,11 @@ src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts:3:6 - error: Unexp - // @GQLtYPE + /** @GQLtYPE */ export default class Composer { --- Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) -- +``` + +#### Code Action: "Convert to a docblock comment" (convert-line-comment-to-docblock-comment) + +```diff - Original + Fixed @@ -50,12 +57,18 @@ src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts:3:6 - error: Unexp - // @gqlfield + /** @gqlfield */ url(): string { +``` --- Applied Fixes -- - * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts +#### Applied Fixes + +```text +* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts +``` + +#### Fixed Text --- Fixed Text -- +```typescript /** @GQLtYPE */ export default class Composer { /** @gqlfield */ diff --git a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md index 95fc5a35..f95fd4c3 100644 --- a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md @@ -9,15 +9,18 @@ class Composer {} ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts:3:4 - error: Unexpected Grats tag in non-JSDoc-style block comment. Grats only looks for tags in JSDoc-style block comments which start with `/**`. For more information see: https://grats.capt.dev/docs/getting-started/comment-syntax 3 /* @gqlType */ ~~~~~~~~ +``` +#### Code Action: "Convert to a docblock comment" (convert-block-comment-to-docblock-comment) --- Code Action: "Convert to a docblock comment" (convert-block-comment-to-docblock-comment) -- +```diff - Original + Fixed @@ -26,11 +29,17 @@ src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts:3:4 - error: Unexpec - /* @gqlType */ + /** @gqlType */ class Composer {} +``` + +#### Applied Fixes + +```text +* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript // Oops! Forgot to use two asterisks for the JSDoc block comment. /** @gqlType */ diff --git a/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md b/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md index d7bd54da..9f27f260 100644 --- a/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/headerIsArrayWithNumber.invalid.ts.expected.md @@ -11,6 +11,8 @@ export default class SomeType { ## Output -``` +### Error Report + +```text error: Expected property `schemaHeader` to be a string or array of strings, but got ["Hello",1]. ``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md b/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md index 90a9456e..c9999cd1 100644 --- a/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/invalidKey.invalid.ts.expected.md @@ -11,6 +11,8 @@ export default class SomeType { ## Output -``` +### Error Report + +```text error: Unknown Grats config option `invalidKey`. ``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md b/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md index 98dc813c..dea12ffe 100644 --- a/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/multipleInvalidKeys.invalid.ts.expected.md @@ -11,6 +11,8 @@ export default class SomeType { ## Output -``` +### Error Report + +```text error: Unknown Grats config option `invalidKey`. ``` \ No newline at end of file diff --git a/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md b/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md index e17f8a6a..75d9cc1d 100644 --- a/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md +++ b/src/tests/fixtures/configOptions/nonNullableIsNull.invalid.ts.expected.md @@ -11,6 +11,8 @@ export default class SomeType { ## Output -``` +### Error Report + +```text error: The Grats config option `tsSchema` must be a `string` if provided. ``` \ No newline at end of file diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md index fc7d7416..34140b37 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts.expected.md @@ -10,7 +10,9 @@ export type UUID = string; ## Output -``` +### Error Report + +```text src/tests/fixtures/custom_scalars/SpecifiedByMissingUrlinvalid.invalid.ts:3:4 - error: Directive "@specifiedBy" argument "url" of type "String!" is required, but it was not provided. 3 * @gqlAnnotate specifiedBy diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md index 963cdfbc..44606e60 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md @@ -10,17 +10,20 @@ export type UUID = string; ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts:3:4 - error: The `@specifiedBy` tag has been deprecated in favor of `@gqlAnnotate`. Use `@gqlAnnotate specifiedBy(url: "http://example.com")` instead. 3 * @specifiedBy https://tools.ietf.org/html/rfc4122 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 */ ~ +``` +#### Code Action: "Replace @specifiedBy with @gqlAnnotate" (replace-specifiedBy-with-gqlAnnotate) --- Code Action: "Replace @specifiedBy with @gqlAnnotate" (replace-specifiedBy-with-gqlAnnotate) -- +```diff - Original + Fixed @@ -30,11 +33,17 @@ src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts:3:4 - error: T - */ + * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122")*/ export type UUID = string; +``` + +#### Applied Fixes + +```text +* Applied fix "Replace @specifiedBy with @gqlAnnotate" in grats/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Replace @specifiedBy with @gqlAnnotate" in grats/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** * @gqlScalar * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122")*/ diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md index 03b117c1..0b88c58b 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts.expected.md @@ -10,7 +10,9 @@ export type MyEnum = "A" | "B" | "C"; ## Output -``` +### Error Report + +```text src/tests/fixtures/custom_scalars/SpecifiedByOnEnum.invalid.ts:3:4 - error: Directive "@specifiedBy" may not be used on ENUM. 3 * @gqlAnnotate specifiedBy(url: "https://tools.ietf.org/html/rfc4122") diff --git a/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md index f1195900..8852dff4 100644 --- a/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts.expected.md @@ -7,7 +7,9 @@ function Foo() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/custom_scalars/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlScalar` can only be used on type alias declarations. e.g. `type MyScalar = string` 1 /** @gqlScalar Matrix */ diff --git a/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md index 702a7bf5..6a463d3d 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts.expected.md @@ -23,7 +23,9 @@ function func(): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/DefaultArgumentArrayValuesInvalid.invalid.ts:5:15 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md index c08fd5c3..31703ee9 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts.expected.md @@ -26,7 +26,9 @@ type ConnectionInput = { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/DefaultArgumentObjectLiteralDynamicPropertyName.invalid.ts:9:15 - error: Expected a name identifier. Grats expected to find a name here which it could use to derive the GraphQL name. 9 input = { [x]: 10, offset: 100 }, diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md index 12181052..703acd74 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts.expected.md @@ -26,7 +26,9 @@ type ConnectionInput = { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/DefaultArgumentObjectLiteralInterpolation.invalid.ts:9:15 - error: Expected property to be a default assignment. For example: `{ first = 10}`. Grats needs to extract a literal GraphQL value here, and that requires Grats being able to see the literal value in the source code. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md index fcdd35ca..e167b689 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts.expected.md @@ -28,7 +28,9 @@ type ConnectionInput = { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/DefaultArgumentObjectLiteralMultiplePropertyErrors.invalid.ts:7:22 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md index 05f4845a..03e8898d 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts.expected.md @@ -26,7 +26,9 @@ type ConnectionInput = { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/DefaultArgumentObjectLiteralSpread.invalid.ts:9:15 - error: Expected property to be a default assignment. For example: `{ first = 10}`. Grats needs to extract a literal GraphQL value here, and that requires Grats being able to see the literal value in the source code. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md index 8f6c5534..1d9d6702 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts.expected.md @@ -14,7 +14,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticksInterpolated.invalid.ts:6:22 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md b/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md index cb9b8d3d..17952c63 100644 --- a/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md +++ b/src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/default_values/NonLiteralDefaultValue.invalid.ts:4:22 - error: Expected GraphQL field argument default values to be a literal. Grats interprets argument defaults as GraphQL default values, which must be literals. For example: `10` or `"foo"`. If you think Grats should be able to infer this constant value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md b/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md index ddead835..d743727c 100644 --- a/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts.expected.md @@ -29,7 +29,9 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/cyclicContextDependency.invalid.ts:10:5 - error: Cyclic dependency detected in derived context. This derived context value depends upon itself. 10 /** @gqlContext */ diff --git a/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md b/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md index c9d1314e..ffbe3337 100644 --- a/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts.expected.md @@ -44,7 +44,9 @@ export function greeting(_: Query, ctx: A): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/cyclicContextDependencyWithChain.invalid.ts:10:5 - error: Cyclic dependency detected in derived context. This derived context value depends upon itself. 10 /** @gqlContext */ diff --git a/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md index 9abee6dd..6c8165f5 100644 --- a/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextChain.invalid.ts.expected.md @@ -51,7 +51,9 @@ export function consumingMultipleContexts( ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/derivedContextChain.invalid.ts:6:5 - error: Cyclic dependency detected in derived context. This derived context value depends upon itself. 6 /** @gqlContext */ diff --git a/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md index d5b61f4c..0582e48f 100644 --- a/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts.expected.md @@ -26,7 +26,9 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/derivedContextNoReturnType.invalid.ts:11:1 - error: Expected derived resolver to have an explicit return type. This is needed to allow Grats to "see" which type to treat as a derived context type. 11 export function createDerivedContext(ctx: RootContext) { diff --git a/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md index 305b0127..f3c3fd53 100644 --- a/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts.expected.md @@ -26,7 +26,9 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/derivedContextNonNamedReturnType.invalid.ts:11:57 - error: Expected derived resolver to have an explicit return type. This is needed to allow Grats to "see" which type to treat as a derived context type. 11 export function createDerivedContext(ctx: RootContext): { greeting: string } { diff --git a/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md index c07e9b81..2f191ff8 100644 --- a/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts.expected.md @@ -31,7 +31,9 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/multipleDerivedContextsSameType.invalid.ts:6:1 - error: Multiple derived contexts defined for given type 6 type DerivedContext = { diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md index 9afa26bb..54c15d9d 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts.expected.md @@ -29,7 +29,9 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/simpleDerivedContextReadsRandomType.invalid.ts:13:3 - error: Invalid type for derived context function argument. Derived context functions may only accept other `@gqlContext` types as arguments. 13 oops: string, diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md index ae9f76e3..36a64fd1 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts.expected.md @@ -26,7 +26,9 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/derived_context/simpleDerivedContextUndefinedType.invalid.ts:11:57 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 11 export function createDerivedContext(ctx: RootContext): DerivedContext { diff --git a/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md b/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md index f3177815..56143905 100644 --- a/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md +++ b/src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts.expected.md @@ -16,7 +16,9 @@ export function queryField(_: Query): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/descriptions/DescriptionFollowsTypeTag.invalid.ts:2:4 - error: Expected text following a `@gqlType` tag to be a GraphQL name. If you intended this text to be a description, place it at the top of the docblock before any `@tags`. 2 * @gqlType diff --git a/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md b/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md index 83ad2b83..db0c37cd 100644 --- a/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md +++ b/src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts.expected.md @@ -14,7 +14,9 @@ export function queryField(_: Query): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/descriptions/DescriptionOnLineOfTypeTag.invalid.ts:2:4 - error: Expected text following a `@gqlType` tag to be a GraphQL name. If you intended this text to be a description, place it at the top of the docblock before any `@tags`. 2 * @gqlType This is a note for myself diff --git a/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md b/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md index 2883ec90..a7435daf 100644 --- a/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md +++ b/src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts.expected.md @@ -14,7 +14,9 @@ class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/descriptions/RenameFollowedByDescription.invalid.ts:2:4 - error: Expected text following a `@gqlType` tag to be a GraphQL name. If you intended this text to be a description, place it at the top of the docblock before any `@tags`. 2 * @gqlType User diff --git a/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md index 67ffcc6b..b62a3557 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts.expected.md @@ -10,7 +10,9 @@ export function customDirective() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/defineCustomDirectiveLocationInvalid.invalid.ts:3:4 - error: Syntax Error: Unexpected Name "WHOOPS". 3 * @gqlDirective on WHOOPS diff --git a/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md index e326eda5..319c0922 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts.expected.md @@ -10,7 +10,9 @@ function customDirective() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/defineCustomDirectiveNoLocation.invalid.ts:3:4 - error: Expected `@gqlDirective` tag to specify at least one location. 3 * @gqlDirective diff --git a/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md index 3d7f20cc..557dde25 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts.expected.md @@ -11,7 +11,9 @@ function customDirective() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/defineCustomDirectiveOnIsNotString.invalid.ts:3:65 - error: Expected Grats JSDoc tag value to be simple text. 3 * @gqlDirective on FIELD_DEFINITION This is a description with {@link https://example.com some link} diff --git a/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md index 1c7b3046..c6526e48 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts.expected.md @@ -13,7 +13,9 @@ export function customDirective(oops: Ctx) {} ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/defineCustomDirectiveReadsContext.invalid.ts:8:33 - error: Expected first argument of a `@gqlDirective` function to be typed using an inline object literal. 8 export function customDirective(oops: Ctx) {} diff --git a/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md index 3d0b563a..b10cc676 100644 --- a/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveArgFieldInvalid.invalid.ts.expected.md @@ -22,7 +22,9 @@ export function myQueryField(): string { ## Output -``` +### Error Report + +```text GraphQL request:1:27 - error: String cannot represent a non string value: 10 1 @customDirective(foo: {a: 10}) diff --git a/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md index 3f6bf939..4c01b641 100644 --- a/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveArgInvalidOneOf.invalid.ts.expected.md @@ -22,7 +22,9 @@ export function myQueryField(): string { ## Output -``` +### Error Report + +```text GraphQL request:1:23 - error: OneOf Input Object "MyInput" must specify exactly one key. 1 @customDirective(foo: {a: "a", b: "b"}) diff --git a/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md index 39ee64c1..ad801478 100644 --- a/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveNotConst.invalid.ts.expected.md @@ -15,7 +15,9 @@ export function myQueryField(): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/directiveNotConst.invalid.ts:6:4 - error: Syntax Error: Unexpected variable "$foo" in constant value. 6 * @gqlAnnotate myDirective(someArg: $foo) diff --git a/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md index 6a018ffb..c1ebc328 100644 --- a/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveUsedWithInvalidArgs.invalid.ts.expected.md @@ -18,7 +18,9 @@ export function myQueryField(): string { ## Output -``` +### Error Report + +```text GraphQL request:1:23 - error: String cannot represent a non string value: 10 1 @customDirective(foo: 10) diff --git a/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md b/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md index 1001861c..fc1931dd 100644 --- a/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts.expected.md @@ -15,7 +15,9 @@ export function myQueryField(): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/directiveWithSyntaxError.invalid.ts:6:4 - error: Syntax Error: Invalid number, expected digit but got: "-". 6 * @gqlAnnotate myDirective(someArg: --oops) diff --git a/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md b/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md index 26c76f58..941177dc 100644 --- a/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md +++ b/src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts.expected.md @@ -12,7 +12,9 @@ export function myQueryField(): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/directives/undefinedDirectiveWithArgs.invalid.ts:3:4 - error: Unknown directive "@myDirective". 3 * @gqlAnnotate myDirective(someArg: "someValue") diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md index e8045daa..6b3416f3 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts.expected.md @@ -13,7 +13,9 @@ type MyEnum = "VALID" | number; ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/EnumFromUnionTypeNotLiteral.invalid.ts:8:25 - error: Expected `@gqlEnum` enum members to be string literal types. For example: `'foo'`. Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md index 5d35cc71..805054a0 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts.expected.md @@ -13,7 +13,9 @@ type MyEnum = "VALID" | 1; ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/EnumFromUnionTypeNotStringLiteral.invalid.ts:8:25 - error: Expected `@gqlEnum` enum members to be string literal types. For example: `'foo'`. Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md index 45006149..4b0d156b 100644 --- a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md @@ -21,8 +21,9 @@ export function favoriteColor(_: Query): Color { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts:4:1 - error: Expected enum to be exported when `tsClientEnums` is configured. Grats needs to import enum types to build the enums module. 4 enum Color { @@ -34,9 +35,11 @@ src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts:4:1 - err ~~~~~~~~~~~~~~~~ 8 } ~ +``` +#### Code Action: "Add export keyword to enum with @gqlEnum" (add-export-keyword-to-enum) --- Code Action: "Add export keyword to enum with @gqlEnum" (add-export-keyword-to-enum) -- +```diff - Original + Fixed @@ -45,11 +48,17 @@ src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts:4:1 - err - enum Color { + export enum Color { RED = "red", +``` + +#### Applied Fixes + +```text +* Applied fix "Add export keyword to enum with @gqlEnum" in grats/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add export keyword to enum with @gqlEnum" in grats/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript // {"tsClientEnums": "enums.ts"} /** @gqlEnum */ diff --git a/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md index 4c9e1430..3763c521 100644 --- a/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts.expected.md @@ -16,7 +16,9 @@ export enum Enum { ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/EnumNotValidIdentifier.invalid.ts:10:13 - error: Names must only contain [_a-zA-Z0-9] but "NOT AT ALL VALID" does not. 10 INVALID = "NOT AT ALL VALID", diff --git a/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md b/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md index 00caa22b..89c1a36d 100644 --- a/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts.expected.md @@ -10,7 +10,9 @@ enum Enum { ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/ExplicitlyNumericEnum.invalid.ts:3:3 - error: Expected `@gqlEnum` enum members to have string literal initializers. For example: `FOO = 'foo'`. In GraphQL enum values are strings, and Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this enum value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md b/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md index 2a48230a..5f7d6496 100644 --- a/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts.expected.md @@ -29,7 +29,9 @@ export function status(_: Query): Status { ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/ExportedEnumsWithEmitEnumsConfig.invalid.ts:11:1 - error: Type alias enums are not supported when `tsClientEnums` is configured. Use `enum` declarations instead. For example: `export enum Status { PENDING = "pending" }`. 11 export type Status = "PENDING" | "COMPLETE" | "CANCELLED"; diff --git a/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md b/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md index c4866456..6c8f6b0e 100644 --- a/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts.expected.md @@ -10,7 +10,9 @@ enum Enum { ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/ImplicitlyNumericEnum.invalid.ts:3:3 - error: Expected `@gqlEnum` enum members to have string literal initializers. For example: `FOO = 'foo'`. In GraphQL enum values are strings, and Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this enum value, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md b/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md index fecd05fd..5fe6dc50 100644 --- a/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts.expected.md @@ -17,7 +17,9 @@ export function status(_: Query): Status { ## Output -``` +### Error Report + +```text src/tests/fixtures/enums/TypeAliasEnumNotAllowedWithEmitEnums.invalid.ts:4:1 - error: Type alias enums are not supported when `tsClientEnums` is configured. Use `enum` declarations instead. For example: `export enum Status { PENDING = "pending" }`. 4 export type Status = "PENDING" | "COMPLETE" | "CANCELLED"; diff --git a/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md index 85afb39b..05815fae 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts.expected.md @@ -12,7 +12,9 @@ export function greeting(myEnum: MyEnum): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_interface/addStringFieldToEnum.invalid.ts:5:34 - error: Unexpected type passed to `@gqlField` function. `@gqlField` functions can only be used to extend `@gqlType` and `@gqlInterface` types. 5 export function greeting(myEnum: MyEnum): string { diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md index e9ac3886..c081aa94 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts.expected.md @@ -37,7 +37,9 @@ class Admin implements IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_interface/addStringFieldToInterfaceTwice.invalid.ts:9:17 - error: Field "IPerson.greeting" can only be defined once. 9 export function greeting(person: IPerson): string { diff --git a/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md index 516fb4ac..b4b955aa 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts.expected.md @@ -11,7 +11,9 @@ export function greeting(someType: SomeNonGratsType): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_interface/addStringFieldToNonGrats.invalid.ts:4:36 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 export function greeting(someType: SomeNonGratsType): string { diff --git a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md index 74660af6..b7699eac 100644 --- a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts.expected.md @@ -29,7 +29,9 @@ class User implements IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_interface/redefineFiledThatExistsOnConcreteType.invalid.ts:21:3 - error: Field "User.greeting" can only be defined once. 21 greeting(): string { diff --git a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md index e386d070..084a21a2 100644 --- a/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts.expected.md @@ -27,7 +27,9 @@ interface User extends IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_interface/redefineFiledThatExistsOnImplementingInterface.invalid.ts:21:3 - error: Field "User.greeting" can only be defined once. 21 greeting(): string; diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md index a63ae3ac..080f1980 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts.expected.md @@ -14,7 +14,9 @@ export let greeting = (_: SomeType): string => { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/fieldAsArrowFunctionLet.invalid.ts:7:8 - error: Expected `@gqlField` arrow function to be declared as `const`. 7 export let greeting = (_: SomeType): string => { diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md index 537e1708..ea12e99f 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md @@ -14,15 +14,18 @@ const greeting = (_: SomeType): string => { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts:7:7 - error: Expected `@gqlField` to be an exported top-level declaration. Grats needs to import resolver functions into its generated schema module, so the resolver function must be exported from the module. 7 const greeting = (_: SomeType): string => { ~~~~~~~~ +``` +#### Code Action: "Add export keyword to exported arrow function with @gqlField" (add-export-keyword-to-arrow-function) --- Code Action: "Add export keyword to exported arrow function with @gqlField" (add-export-keyword-to-arrow-function) -- +```diff - Original + Fixed @@ -31,11 +34,17 @@ src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts:7:7 - - const greeting = (_: SomeType): string => { + export const greeting = (_: SomeType): string => { return `Hello World`; +``` + +#### Applied Fixes + +```text +* Applied fix "Add export keyword to exported arrow function with @gqlField" in grats/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add export keyword to exported arrow function with @gqlField" in grats/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ class SomeType { // No fields diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md index 2d6a8ba0..368dbf55 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts.expected.md @@ -14,7 +14,9 @@ var greeting = (_: SomeType): string => { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/fieldAsArrowFunctionVar.invalid.ts:7:1 - error: Expected `@gqlField` arrow function to be declared as `const`. 7 var greeting = (_: SomeType): string => { diff --git a/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md index 7d63b041..c003b9da 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts.expected.md @@ -17,7 +17,9 @@ export const greeting = (_: SomeType): string => { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/fieldAsExportedMultipleVariables.invalid.ts:7:1 - error: Expected only one declaration when defining a `@gqlField`, found 2. 7 export const greeting = (_: SomeType): string => { diff --git a/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md index 9cdb891b..a289ddc8 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts.expected.md @@ -12,7 +12,9 @@ export const greeting; ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/fieldAsExportedNothing.invalid.ts:7:1 - error: Expected `@gqlField` on variable declaration to be attached to an arrow function. 7 export const greeting; diff --git a/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md index 8eb243b2..f8b11b4a 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts.expected.md @@ -12,7 +12,9 @@ export const greeting = 10; ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/fieldAsExportedNumber.invalid.ts:7:1 - error: Expected `@gqlField` on variable declaration to be attached to an arrow function. 7 export const greeting = 10; diff --git a/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md b/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md index 92e577b6..0926660a 100644 --- a/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts.expected.md @@ -14,7 +14,9 @@ export function greeting(/* Without an arg we can't infer the type! */): string ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/missingFirstArgument.invalid.ts:7:17 - error: Expected `@gqlField` function to have a first argument representing the type to extend. If you don't need access to the parent object in the function, you can name the variable `_` to indicate that it is unused. e.g. `function myField(_: ParentType) {}` 7 export function greeting(/* Without an arg we can't infer the type! */): string { diff --git a/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md b/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md index 95d5bfcf..964360d6 100644 --- a/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts.expected.md @@ -16,7 +16,9 @@ export function greeting( ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/missingFirstArgumentType.invalid.ts:8:3 - error: Expected first argument of a `@gqlField` function to have an explicit type annotation. Grats treats the first argument as the parent object of the field. Therefore Grats needs to see the _type_ of the first argument in order to know to which type/interface this field should be added. 8 query /* Without an arg type we can't infer the GraphQL type to extend! */, diff --git a/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md b/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md index f2140a38..6cbfdb0d 100644 --- a/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts.expected.md @@ -14,7 +14,9 @@ export function greeting(query: { name: string }): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/nonAliasFirstArgumentType.invalid.ts:7:33 - error: Expected first argument of a `@gqlField` function to be typed as a type reference. Grats treats the first argument as the parent object of the field. Therefore Grats needs to see the _type_ of the first argument in order to know to which type/interface this field should be added. 7 export function greeting(query: { name: string }): string { diff --git a/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md b/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md index 8cc98ef0..fb6dfef8 100644 --- a/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts.expected.md @@ -16,7 +16,9 @@ export function greeting(query: Foo): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/extend_type/nonGQLFirstArgumentType.invalid.ts:9:33 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 9 export function greeting(query: Foo): string { diff --git a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md index 9908f7fd..93880666 100644 --- a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md @@ -14,15 +14,18 @@ function greeting(_: Query): string { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/extend_type/notExported.invalid.ts:7:10 - error: Expected a `@gqlField` function to be a named export. Grats needs to import resolver functions into its generated schema module, so the resolver function must be a named export. 7 function greeting(_: Query): string { ~~~~~~~~ +``` +#### Code Action: "Add export keyword to function with @gqlField" (add-export-keyword-to-function) --- Code Action: "Add export keyword to function with @gqlField" (add-export-keyword-to-function) -- +```diff - Original + Fixed @@ -31,11 +34,17 @@ src/tests/fixtures/extend_type/notExported.invalid.ts:7:10 - error: Expected a ` - function greeting(_: Query): string { + export function greeting(_: Query): string { return `Hello World`; +``` + +#### Applied Fixes + +```text +* Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/extend_type/notExported.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/extend_type/notExported.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ class SomeType { // No fields diff --git a/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md index b01cf399..6b2e6926 100644 --- a/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts.expected.md @@ -12,7 +12,9 @@ export class User { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FieldAsSetter.invalid.ts:4:3 - error: `@gqlField` can only be used on method/property declarations, signatures, function or static method declarations. If you think Grats should be able to infer this field, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md index 813b7043..dbcb575d 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts.expected.md @@ -20,7 +20,9 @@ type Query = unknown; ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScope.invalid.ts:3:9 - error: Expected class with a static `@gqlField` method to be a top-level declaration. Grats needs to import resolver methods into its generated schema module, so the resolver's class must be an exported. 3 class User { diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md index 9c4cd69e..7c996228 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts.expected.md @@ -20,7 +20,9 @@ type Query = unknown; ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FieldAsStaticClassMethodInNestedScopeButExported.invalid.ts:3:16 - error: Expected class with a static `@gqlField` method to be a top-level declaration. Grats needs to import resolver methods into its generated schema module, so the resolver's class must be an exported. 3 export class User { diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md index 1d868e86..8e67547c 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md @@ -18,8 +18,9 @@ type Query = unknown; ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts:2:7 - error: Expected `@gqlField` static method's class to be exported. Grats needs to import resolvers into its generated schema module, so the resolver class must be an exported. 2 class User { @@ -29,8 +30,11 @@ src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid 6 /** @gqlField */ ~~~~~~~~~~ Field defined here +``` + +#### Code Action: "Add export keyword to class with static @gqlField" (add-export-keyword-to-class) --- Code Action: "Add export keyword to class with static @gqlField" (add-export-keyword-to-class) -- +```diff - Original + Fixed @@ -39,11 +43,17 @@ src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid - class User { + export class User { /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Add export keyword to class with static @gqlField" in grats/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add export keyword to class with static @gqlField" in grats/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User { /** @gqlField */ diff --git a/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md index 1b03c3c2..353e5a08 100644 --- a/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts.expected.md @@ -9,7 +9,9 @@ class Foo { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FieldDefinedOnNonGqlType.invalid.ts:2:8 - error: Unexpected `@gqlField`. The parent construct must be either a `@gqlType` or `@gqlInterface` tag. Are you missing one of these tags? 2 /** @gqlField */ diff --git a/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md index 158c58a7..111d3446 100644 --- a/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts.expected.md @@ -11,7 +11,9 @@ class Foo { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FieldOnArbitraryParam.invalid.ts:4:5 - error: `@gqlField` can only be used on method/property declarations, signatures, function or static method declarations. If you think Grats should be able to infer this field, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md index d4473d71..39298822 100644 --- a/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts.expected.md @@ -11,7 +11,9 @@ class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FieldTagOnIncorrectNode.invalid.ts:3:3 - error: `@gqlField` can only be used on method/property declarations, signatures, function or static method declarations. If you think Grats should be able to infer this field, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md index 042d3c7b..120695c4 100644 --- a/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/FiledWithUnionOfMultipleTypes.invalid.ts:4:12 - error: Expected exactly one non-nullish type. GraphQL does not support fields returning an arbitrary union of types. Consider defining an explicit `@gqlUnion` union type and returning that. 4 hello(): string | boolean { diff --git a/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md index cad15a47..99fa9159 100644 --- a/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts.expected.md @@ -12,7 +12,9 @@ class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/MethodFieldMissingType.invalid.ts:4:3 - error: Expected GraphQL field methods to have an explicitly defined return type. Grats needs to be able to see the type of the field to generate its type in the GraphQL schema. 4 someMethodField() { diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md index 53de84b5..8f00a532 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/ParameterPropertyFieldBindingPattern.invalid.ts:5:12 - error: Expected a name identifier. Grats expected to find a name here which it could use to derive the GraphQL name. 5 public [foo]: string, diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md index 26fc3336..0efa51cf 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md @@ -14,17 +14,20 @@ export default class SomeType { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts:5:5 - error: Expected `@gqlField` constructor parameter to be a parameter property. This requires a modifier such as `public` or `readonly` before the parameter name. Learn more: https://grats.capt.dev/docs/docblock-tags/fields#class-based-fields 5 hello: string, ~~~~~~~~~~~~~ +``` +#### Code Action: "Add 'public' modifier" (add-public-modifier) --- Code Action: "Add 'public' modifier" (add-public-modifier) -- +```diff - Original + Fixed @@ -33,11 +36,17 @@ Learn more: https://grats.capt.dev/docs/docblock-tags/fields#class-based-fields - hello: string, + public hello: string, ) { +``` + +#### Applied Fixes + +```text +* Applied fix "Add 'public' modifier" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add 'public' modifier" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export default class SomeType { constructor( diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md index 094f9ec1..6c0b499c 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts.expected.md @@ -12,7 +12,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/ParameterPropertyFieldNoType.invalid.ts:5:5 - error: Expected `@gqlField` parameter property to have an explicit type annotation. Grats needs to be able to see the type of the parameter property to generate a GraphQL schema. 5 public hello, diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md index 5cd4ddd2..61875398 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md @@ -15,17 +15,20 @@ export default class SomeType { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts:8:5 - error: Expected `@gqlField` parameter property to be public. Valid modifiers for `@gqlField` parameter properties are `public` and `readonly`. Learn more: https://grats.capt.dev/docs/docblock-tags/fields#class-based-fields 8 private readonly hello: string, ~~~~~~~ +``` +#### Code Action: "Make parameter property public" (make-parameter-property-public) --- Code Action: "Make parameter property public" (make-parameter-property-public) -- +```diff - Original + Fixed @@ -34,11 +37,17 @@ Learn more: https://grats.capt.dev/docs/docblock-tags/fields#class-based-fields - private readonly hello: string, + public readonly hello: string, ) {} +``` + +#### Applied Fixes + +```text +* Applied fix "Make parameter property public" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Make parameter property public" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export default class SomeType { constructor( diff --git a/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md index 05b5c64a..72b366d3 100644 --- a/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts.expected.md @@ -16,7 +16,9 @@ export class User { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/PrivateAndProtectedFieldMethods.invalid.ts:4:3 - error: Unexpected access modifier on `@gqlField` method. GraphQL fields must be able to be called by the GraphQL executor. 4 private greet(): string { diff --git a/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md index 018cc5f2..213daad9 100644 --- a/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts.expected.md @@ -10,7 +10,9 @@ class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/PropertyFieldMissingType.invalid.ts:4:3 - error: Expected GraphQL field to have an explicitly defined type annotation. Grats needs to be able to see the type of the field to generate a field's type in the GraphQL schema. 4 someProp; diff --git a/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md index 98b351bc..09e26796 100644 --- a/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts.expected.md @@ -12,7 +12,9 @@ class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/ReferenceNonGraphQLType.invalid.ts:6:22 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 6 somePropertyField: SomeUndefienedType; diff --git a/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md index b839afc9..4cee59f8 100644 --- a/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts.expected.md @@ -10,7 +10,9 @@ class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_definitions/ReferenceUndefinedType.invalid.ts:4:22 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 somePropertyField: SomeUndefienedType; diff --git a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md index 9f9af31c..6939e019 100644 --- a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md @@ -12,15 +12,18 @@ type Query = unknown; ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts:2:16 - error: Expected a `@gqlField` function to be a named export. Grats needs to import resolver functions into its generated schema module, so the resolver function must be a named export. 2 async function greet(_: Query): Promise { ~~~~~ +``` +#### Code Action: "Add export keyword to function with @gqlField" (add-export-keyword-to-function) --- Code Action: "Add export keyword to function with @gqlField" (add-export-keyword-to-function) -- +```diff - Original + Fixed @@ -29,11 +32,17 @@ src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts:2: - async function greet(_: Query): Promise { + export async function greet(_: Query): Promise { return "Hello, World!"; +``` + +#### Applied Fixes + +```text +* Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlField */ export async function greet(_: Query): Promise { return "Hello, World!"; diff --git a/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md b/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md index 3110f446..ed132ecb 100644 --- a/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/DuplicateFields.invalid.ts.expected.md @@ -18,7 +18,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_values/DuplicateFields.invalid.ts:6:3 - error: Field "SomeType.hello" can only be defined once. 6 hello(): string { diff --git a/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md b/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md index 19ab362d..9bc116b3 100644 --- a/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts.expected.md @@ -26,7 +26,9 @@ export class User implements IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_values/KillsParentOnExceptionDoesNotMatchInterface.invalid.ts:4:7 - error: Interface field IPerson.name expects type String! but User.name is type String. 4 * @killsParentOnException diff --git a/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md b/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md index 3171bfbc..83648d86 100644 --- a/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts.expected.md @@ -15,7 +15,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_values/OptionalStringFieldKillsParentOnException.invalid.ts:5:7 - error: Unexpected `@killsParentOnException` tag on field typed as nullable. `@killsParentOnException` will force a field to appear as non-nullable in the schema, so its implementation must also be non-nullable. . 5 * @killsParentOnException diff --git a/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md b/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md index 111516d9..d2329f25 100644 --- a/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md +++ b/src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts.expected.md @@ -16,7 +16,9 @@ export default class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/field_values/StringFieldKillsParentOnExceptionWithoutNullableByDefaultEnables.invalid.ts:6:7 - error: Unexpected `@killsParentOnException` tag. `@killsParentOnException` is only supported when the Grats config option `nullableByDefault` is enabled in your `tsconfig.json`. 6 * @killsParentOnException diff --git a/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md b/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md index 0b23471f..7773059a 100644 --- a/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts.expected.md @@ -30,7 +30,9 @@ type Foo = { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/arrayPassedToGeneric.invalid.ts:19:15 - error: Expected `SomeType` to be passed a GraphQL type argument for type parameter `T`. 19 a: SomeType; diff --git a/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md b/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md index fd83b82f..4d4a3e73 100644 --- a/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/enumWithGeneric.invalid.ts.expected.md @@ -7,7 +7,9 @@ type MyEnum = T | "someValue"; ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/enumWithGeneric.invalid.ts:2:18 - error: Expected `@gqlEnum` enum members to be string literal types. For example: `'foo'`. Grats needs to be able to see the concrete value of the enum member to generate the GraphQL schema. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md index 3d9224b2..fc330e6b 100644 --- a/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts.expected.md @@ -22,7 +22,9 @@ type SomeUnion = Page | Edge; ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/genericTypeUsedAsUnionMember.invalid.ts:17:25 - error: Unexpected generic type used as union member. Generic type may not currently be used as members of a union. Grats requires that all union members define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus cannot be used as members of a union. 17 type SomeUnion = Page | Edge; diff --git a/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md index c0c77a86..50f417af 100644 --- a/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts.expected.md @@ -20,7 +20,9 @@ type SomeUnion = Page | T; ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/genericTypeUsedAsUnionMemberViaTypeParam.invalid.ts:5:18 - error: Unexpected generic type used as union member. Generic type may not currently be used as members of a union. Grats requires that all union members define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus cannot be used as members of a union. 5 foo: SomeUnion>; diff --git a/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md b/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md index ccf73219..b6d95028 100644 --- a/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts.expected.md @@ -18,7 +18,9 @@ export type PageConnection = { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/missingGqlGenericTypeArg.invalid.ts:12:10 - error: Missing type argument for generic GraphQL type. Expected `Edge` to be passed a GraphQL type argument for type parameter `T`. 12 edges: Edge[]; diff --git a/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md b/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md index 5980a75d..0718d309 100644 --- a/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts.expected.md @@ -22,7 +22,9 @@ class SomeClass { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/passOuptutTypeToInputType.input.invalid.ts:3:14 - error: The type of SomeClassSomeInput.someField must be Input Type but got: SomeClass!. 3 someField: T; diff --git a/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md b/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md index 96f47999..9b973f61 100644 --- a/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts.expected.md @@ -12,7 +12,9 @@ export function greeting(_: Query): T { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/referencingMethodGeneric.invalid.ts:5:40 - error: Type parameter not valid 5 export function greeting(_: Query): T { diff --git a/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md b/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md index 223ab7ad..96ec9d14 100644 --- a/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts.expected.md @@ -16,7 +16,9 @@ type OtherType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/scalarPassedAsGenericArg.invalid.ts:10:20 - error: Expected `Wrapper` to be passed a GraphQL type argument for type parameter `T`. 10 wrapper: Wrapper; diff --git a/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md b/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md index f42f73b7..a1fe6f47 100644 --- a/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts.expected.md @@ -25,7 +25,9 @@ class Dog { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/todo/genericInterfaceFromTypeParam.invalid.ts:2:33 - error: Unexpected `implements` on generic `gqlType`. Generic types may not currently declare themselves as implementing interfaces. Grats requires that all types which implement an interface define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus declare themselves as interface implementors. 2 export class User implements Friendly { diff --git a/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md b/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md index a12254dd..e9efc570 100644 --- a/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts.expected.md @@ -28,7 +28,9 @@ class Dog { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/todo/genericTypeImplementsInterface.invalid.ts:2:33 - error: Unexpected `implements` on generic `gqlType`. Generic types may not currently declare themselves as implementing interfaces. Grats requires that all types which implement an interface define a `__typename` field typed as a string literal matching the type's name. Since generic types are synthesized into multiple types with different names, Grats cannot ensure they have a correct `__typename` property and thus declare themselves as interface implementors. 2 export class User implements Friendly { diff --git a/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md b/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md index e343f0ac..42703379 100644 --- a/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md +++ b/src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts.expected.md @@ -18,7 +18,9 @@ export type PageConnection = { ## Output -``` +### Error Report + +```text src/tests/fixtures/generics/undefinedTypeUsedAsGenericTypeArg.invalid.ts:12:15 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 12 edges: Edge[]; diff --git a/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md index 67b7eefc..52cbbac9 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts.expected.md @@ -10,7 +10,9 @@ export type Greeting = { firstName: string } | { lastName: string }; ## Output -``` +### Error Report + +```text src/tests/fixtures/input_type_one_of/oneOfDeprecated.invalid.ts:3:5 - error: Directive "@deprecated" may not be used on INPUT_OBJECT. 3 * @deprecated Don't use this any more diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md index 2ea46ed5..d0f83ce9 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts.expected.md @@ -9,7 +9,9 @@ export type Greeting = { firstName: string } | { lastName }; ## Output -``` +### Error Report + +```text src/tests/fixtures/input_type_one_of/oneOfFieldMissingTypeAnnotation.invalid.ts:4:50 - error: Expected each property of a @oneOf @gqlInput to have a type annotation. 4 export type Greeting = { firstName: string } | { lastName }; diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md index 41bfc3f9..0e8b5ebc 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts.expected.md @@ -9,7 +9,9 @@ export type Greeting = { firstName: string } | { lastName: Set }; ## Output -``` +### Error Report + +```text src/tests/fixtures/input_type_one_of/oneOfFieldTypeNotGraphQL.invalid.ts:4:60 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 export type Greeting = { firstName: string } | { lastName: Set }; diff --git a/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md index d41ef049..ebb8336f 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts.expected.md @@ -11,7 +11,9 @@ export type Greeting = ## Output -``` +### Error Report + +```text src/tests/fixtures/input_type_one_of/oneOfMemberHasMultipleFields.invalid.ts:6:5 - error: Expected each member of a @oneOf @gqlInput to be a TypeScript object literal with exactly one property. 6 | { lastName: string; nickName: string }; diff --git a/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md index 3543a51c..3c970002 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts.expected.md @@ -9,7 +9,9 @@ type Greeting = { firstName: string } | {}; ## Output -``` +### Error Report + +```text src/tests/fixtures/input_type_one_of/oneOfMemberHasNoField.invalid.ts:4:41 - error: Expected each member of a @oneOf @gqlInput to be a TypeScript object literal with exactly one property. 4 type Greeting = { firstName: string } | {}; diff --git a/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md index 0bd1eb78..9313bd36 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts.expected.md @@ -9,7 +9,9 @@ export type Greeting = string | { name: string }; ## Output -``` +### Error Report + +```text src/tests/fixtures/input_type_one_of/oneOfUnionMemberNotLiteral.invalid.ts:4:24 - error: Expected each member of a @oneOf @gqlInput to be a TypeScript object literal with exactly one property. 4 export type Greeting = string | { name: string }; diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md index 604f4bbd..24ded58f 100644 --- a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md @@ -10,17 +10,20 @@ export type Greeting = { firstName: string } | { lastName: string }; ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts:3:4 - error: The `@oneOf` tag has been deprecated. Grats will now automatically add the `@oneOf` directive if you define your input type as a TypeScript union. You can remove the `@oneOf` tag. 3 * @oneOf ~~~~~~ 4 */ ~ +``` +#### Code Action: "Remove @oneOf tag" (remove-oneOf-tag) --- Code Action: "Remove @oneOf tag" (remove-oneOf-tag) -- +```diff - Original + Fixed @@ -30,11 +33,17 @@ src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts:3:4 - e - */ + * */ export type Greeting = { firstName: string } | { lastName: string }; +``` + +#### Applied Fixes + +```text +* Applied fix "Remove @oneOf tag" in grats/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Remove @oneOf tag" in grats/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** * @gqlInput * */ diff --git a/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md b/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md index fbbc3916..32d82ca9 100644 --- a/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts.expected.md @@ -14,7 +14,9 @@ type MyInputType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/ContextReferencedInInputType.invalid.ts:8:14 - error: Cannot use `gqlContext` as a type in GraphQL type position. 8 someField: SomeType; diff --git a/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md b/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md index f0a0e3f0..a4974e31 100644 --- a/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts.expected.md @@ -19,7 +19,9 @@ type MyInputType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/DeprecatedInputType.invalid.ts:10:5 - error: Directive "@deprecated" may not be used on INPUT_OBJECT. 10 * @deprecated This old thing? diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md index 2b63cab7..e5a3c41e 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts.expected.md @@ -11,7 +11,9 @@ interface MyInputType { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeInterfaceFunction.invalid.ts:5:3 - error: `@gqlInput` types only support property signature members. e.g. `type MyInput = { foo: string }` If you think Grats should be able to infer this input field, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md index 3d850f0c..7e5bd030 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts.expected.md @@ -9,7 +9,9 @@ interface MyInputType { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeInterfaceMethod.invalid.ts:3:3 - error: `@gqlInput` types only support property signature members. e.g. `type MyInput = { foo: string }` If you think Grats should be able to infer this input field, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md index e6cc4407..a9b1fa39 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts.expected.md @@ -9,7 +9,9 @@ interface MyInputType { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeInterfacePromiseField.invalid.ts:3:15 - error: `Promise` is not a valid as an input type. 3 someMethod: Promise; diff --git a/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md index 58e3904f..e4b50954 100644 --- a/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts.expected.md @@ -13,7 +13,9 @@ interface MyInputType { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeMergedInterface.invalid.ts:6:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces diff --git a/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md index cec81669..9b76c20c 100644 --- a/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts.expected.md @@ -15,7 +15,9 @@ type MyInputType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeReferencingOutputType.invalid.ts:9:14 - error: The type of MyInputType.someField must be Input Type but got: SomeType!. 9 someField: SomeType; diff --git a/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md index 1d6b92f3..dbc1e986 100644 --- a/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts.expected.md @@ -21,7 +21,9 @@ type MyInputType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeReturnedFromField.invalid.ts:15:14 - error: The type of MyInputType.someField must be Input Type but got: MyType!. 15 someField: MyType; diff --git a/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md index 8de9d0b8..48d72c49 100644 --- a/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts.expected.md @@ -18,7 +18,9 @@ type MyInputType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/input_types/InputTypeWithDeprecatedRequiredField.invalid.ts:10:7 - error: Required input field MyInputType.someField cannot be deprecated. 10 * @deprecated Sweet, but stale diff --git a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md index ba9cacc8..89c90ea5 100644 --- a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md @@ -10,15 +10,18 @@ type Foo = { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts:3:7 - error: The tag `@gqlField` is not needed on fields of input types. All fields are automatically included as part of the input type. This tag can be safely removed. 3 /** @gqlField */ ~~~~~~~~~~ +``` +#### Code Action: "Remove @gqlField tag" (remove-gql-field-from-input) --- Code Action: "Remove @gqlField tag" (remove-gql-field-from-input) -- +```diff - Original + Fixed @@ -27,11 +30,17 @@ src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts:3:7 - error: Th - /** @gqlField */ + name: string; +``` + +#### Applied Fixes + +```text +* Applied fix "Remove @gqlField tag" in grats/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Remove @gqlField tag" in grats/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlInput */ type Foo = { diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md index 178cae95..0eea4599 100644 --- a/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts.expected.md @@ -14,7 +14,9 @@ interface Foo { ## Output -``` +### Error Report + +```text src/tests/fixtures/interfaces/InterfaceMergedIntoClass.invalid.ts:6:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces diff --git a/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md index 0c747980..658c557b 100644 --- a/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts.expected.md @@ -7,7 +7,9 @@ interface SomeType {} ## Output -``` +### Error Report + +```text src/tests/fixtures/interfaces/InterfaceMissingFields.invalid.ts:2:11 - error: Interface `SomeType` must define one or more fields. Define a field by adding `/** @gqlField */` above a field, property, attribute or method of this type, or above a function that has `SomeType` as its first argument. diff --git a/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md b/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md index 4bb981f0..b286e9cf 100644 --- a/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts.expected.md @@ -24,7 +24,9 @@ interface Node { ## Output -``` +### Error Report + +```text src/tests/fixtures/interfaces/MergedInterfaces.invalid.ts:16:11 - error: Unexpected merged interface. If an interface is declared multiple times in a scope, TypeScript merges them. To avoid ambiguity Grats does not support using merged interfaces as GraphQL definitions. Consider using a unique name for your TypeScript interface and renaming it. Learn more: https://grats.capt.dev/docs/docblock-tags/interfaces/#merged-interfaces diff --git a/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md index 9cfbe95b..558423eb 100644 --- a/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts.expected.md @@ -7,7 +7,9 @@ function Foo() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/interfaces/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlInterface` can only be used on interface declarations. e.g. `interface MyInterface {}` 1 /** @gqlInterface Person */ diff --git a/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md b/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md index 428a0f3a..0eaad207 100644 --- a/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts.expected.md @@ -9,7 +9,9 @@ function hello() { ## Output -``` +### Error Report + +```text src/tests/fixtures/interfaces/tag/ImplementsTagWithoutTypeOrInterface.invalid.ts:1:6 - error: `@gqlImplements` has been deprecated. Instead use `class MyType implements MyInterface`. 1 /** @gqlImplements Node */ diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md index 0e67fcf5..d227725c 100644 --- a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts.expected.md @@ -16,7 +16,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ClassMethodWithContextValueInArgsPos.invalid.ts:8:17 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 8 greeting(ctx: GratsContext): string { diff --git a/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md index 73959375..812e14d5 100644 --- a/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts.expected.md @@ -12,7 +12,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ContextValueMissingTypeAnnotation.invalid.ts:4:12 - error: Missing type annotation for resolver argument. Expected all resolver arguments to have an explicit type annotation. Grats needs to be able to see the type of the arguments to generate an executable GraphQL schema. 4 greeting(ctx): string { diff --git a/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md index 583719c1..28b221ef 100644 --- a/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts.expected.md @@ -15,7 +15,9 @@ type SomeOtherType = { greeting: string }; ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ContextValueSpread.invalid.ts:4:12 - error: Unexpected spread argument in resolver. Grats expects all resolver arguments to be a single, explicitly-typed argument. 4 greeting(...ctx: SomeOtherType[]): string { diff --git a/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md index 8d49de27..351fa12c 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts.expected.md @@ -12,7 +12,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ContextValueTypeNotDefined.invalid.ts:4:17 - error: Unable to resolve type reference. In order to generate a GraphQL schema, Grats needs to determine which GraphQL type is being referenced. This requires being able to resolve type references to their `@gql` annotated declaration. However this reference could not be resolved. Is it possible that this type is not defined in this file? 4 greeting(ctx: ThisIsNeverDefined): string { diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md index ccfd0f1d..c2c0306d 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts.expected.md @@ -12,7 +12,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ContextValueTypedAsAny.invalid.ts:4:17 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md index 627f6682..0b1be5f0 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected.md @@ -12,7 +12,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts:4:17 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md index 09396be1..39a4e037 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts.expected.md @@ -12,7 +12,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/ContextValueTypedAsUnknown.invalid.ts:4:17 - error: Unknown GraphQL type. Grats does not know how to map this type to a GraphQL type. You may want to define a named GraphQL type elsewhere and reference it here. If you think Grats should be able to infer a GraphQL type from this type, please file an issue. If you think Grats should be able to infer this type, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md b/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md index d428af35..39d0d3ba 100644 --- a/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md +++ b/src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts.expected.md @@ -26,7 +26,9 @@ export class SomeType { ## Output -``` +### Error Report + +```text src/tests/fixtures/resolver_context/MultipleContextValuesUsed.invalid.ts:6:5 - error: Unexpected duplicate `@gqlContext` tag. Only one type in a project may be annotated with the `@gqlContext`. 6 /** @gqlContext */ diff --git a/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md b/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md index 96e64508..93af175e 100644 --- a/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts.expected.md @@ -26,7 +26,9 @@ export class User implements IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/semantic_nullability/nonNullDoesNotMatchInterface.invalid.ts:4:7 - error: Interface field IPerson.name expects type String! but User.name is type String. 4 * @killsParentOnException diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md index 6c6930ce..cc5354d7 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts.expected.md @@ -25,7 +25,9 @@ export class User implements IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/semantic_nullability/semanticNonNullDoesNotMatchInterface.invalid.ts:6:11 - error: Interface field `User.name` expects a non-nullable type but `IPerson.name` is nullable. 6 name(): string; diff --git a/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md b/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md index 8a725171..e0b5bff1 100644 --- a/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md +++ b/src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts.expected.md @@ -9,7 +9,9 @@ export type NotSubscription = { ## Output -``` +### Error Report + +```text src/tests/fixtures/subscriptions/InputTypeWithAsyncIterable.invalid.ts:3:14 - error: `AsyncIterable` is not a valid as an input type. 3 greetings: AsyncIterable; diff --git a/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md b/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md index 0a4ec7c3..2134fcf6 100644 --- a/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md +++ b/src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts.expected.md @@ -13,7 +13,9 @@ export class Subscription { ## Output -``` +### Error Report + +```text src/tests/fixtures/subscriptions/SubscriptionClassWithAsyncIterable.invalid.ts:2:14 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 export class Subscription { diff --git a/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md index 3ae0c147..7fe5564e 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts.expected.md @@ -11,7 +11,9 @@ export class SomeNonGraphQLClass { ## Output -``` +### Error Report + +```text src/tests/fixtures/top_level_fields/queryFieldOnMethod.invalid.ts:2:7 - error: `@gqlQueryField` can only be used on function or static method declarations. 2 /** @gqlQueryField */ diff --git a/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md index 2bfecf8b..387c99dc 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts.expected.md @@ -12,7 +12,9 @@ export function greeting(_: Query): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/top_level_fields/queryFieldWithFirstArgParentType.invalid.ts:5:29 - error: The type of Query.greeting(_:) must be Input Type but got: Query!. 5 export function greeting(_: Query): string { diff --git a/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md b/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md index 2505b685..54714ea0 100644 --- a/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts.expected.md @@ -9,7 +9,9 @@ export function foo(): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/top_level_fields/rootSubscriptionFieldNotAsyncIterable.invalid.ts:2:24 - error: Expected fields on `Subscription` to return an `AsyncIterable`. Fields on `Subscription` model a subscription, which is a stream of events. Grats expects fields on `Subscription` to return an `AsyncIterable` which can be used to model this stream. 2 export function foo(): string { diff --git a/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md index 03a5da22..48426ba6 100644 --- a/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts.expected.md @@ -7,7 +7,9 @@ export default class SomeType {} ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/ClassMissingFields.invalid.ts:2:22 - error: Type `SomeType` must define one or more fields. Define a field by adding `/** @gqlField */` above a field, property, attribute or method of this type, or above a function that has `SomeType` as its first argument. diff --git a/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md index b9ef61ea..7889b1af 100644 --- a/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts.expected.md @@ -14,7 +14,9 @@ export default class { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/ClassWithoutAName.invalid.ts:4:1 - error: Unexpected `@gqlType` annotation on unnamed class declaration. Grats uses the name of the class to derive the name of the GraphQL type. Consider naming the class. 4 export default class { diff --git a/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md index 1c5dc03e..81f14313 100644 --- a/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts.expected.md @@ -10,7 +10,9 @@ export default class Query { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/QueryAsClass.invalid.ts:2:22 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 export default class Query { diff --git a/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md index 5f4709ea..4ab89862 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts.expected.md @@ -14,7 +14,9 @@ class MyClass { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/RenamedTypeHasDash.invalid.ts:2:4 - error: Names must only contain [_a-zA-Z0-9] but "Some-Type" does not. 2 * @gqlType Some-Type diff --git a/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md index 9d49540d..ea1bdb06 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts.expected.md @@ -16,7 +16,9 @@ class MyClass { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/RenamedTypeNewLine.invalid.ts:2:4 - error: Expected the GraphQL name `SomeType` to be on the same line as it's `@gqlType` tag. 2 * @gqlType diff --git a/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md index fd43a528..af906419 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts.expected.md @@ -14,7 +14,9 @@ class MyClass { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/RenamedTypeStartsWithNumber.invalid.ts:2:4 - error: Names must start with [_a-zA-Z] but "1SomeType" does not. 2 * @gqlType 1SomeType diff --git a/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md index 3c57e1c4..64651b6a 100644 --- a/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts.expected.md @@ -14,7 +14,9 @@ export default class { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/RenamedTypeWithoutClassName.invalid.ts:4:1 - error: Unexpected `@gqlType` annotation on unnamed class declaration. Grats uses the name of the class to derive the name of the GraphQL type. Consider naming the class. 4 export default class { diff --git a/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md index 5c2f42bb..3f608704 100644 --- a/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts.expected.md @@ -7,7 +7,9 @@ function MyFunc() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlType` can only be used on class, interface or type declarations. e.g. `class MyType {}` 1 /** @gqlType */ diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md index 1c386136..c2018974 100644 --- a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts.expected.md @@ -20,7 +20,9 @@ export default class User { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterfaceWithDeprecatedTag.invalid.ts:9:4 - error: `@gqlImplements` has been deprecated. Instead use `class MyType implements MyInterface`. 9 * @gqlImplements Person diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md index 1f970962..b3f5da9f 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts.expected.md @@ -9,7 +9,9 @@ export type SomeType = { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_alias/AliasIsArrayNotLiteral.invalid.ts:2:24 - error: Expected `@gqlType` type to be an object type literal (`{ }`) or `unknown`. For example: `type Foo = { bar: string }` or `type Query = unknown`. 2 export type SomeType = { diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md index a1307a43..d0d51c59 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts.expected.md @@ -7,7 +7,9 @@ export type SomeType = 10; ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_alias/AliasIsNumberNotLiteral.invalid.ts:2:24 - error: Expected `@gqlType` type to be an object type literal (`{ }`) or `unknown`. For example: `type Foo = { bar: string }` or `type Query = unknown`. 2 export type SomeType = 10; diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md index 3bf33027..a34d1315 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts.expected.md @@ -20,7 +20,9 @@ interface Person { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_alias/AliasTypeImplementsInterface.invalid.ts:3:4 - error: `@gqlImplements` has been deprecated. Types which implement GraphQL interfaces should be defined using TypeScript class or interface declarations. 3 * @gqlImplements Person diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md index 04db27cf..f337c86c 100644 --- a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts.expected.md @@ -12,7 +12,9 @@ export function foo(_: Query): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfObject.invalid.ts:2:14 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 type Query = {}; diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md index eedf0e89..96b22ae3 100644 --- a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts.expected.md @@ -12,7 +12,9 @@ export function foo(_: Query): string { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUndefined.invalid.ts:2:14 - error: Expected `@gqlType` type to be an object type literal (`{ }`) or `unknown`. For example: `type Foo = { bar: string }` or `type Query = unknown`. 2 type Query = undefined; diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md index 1c60df15..df0eb732 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts.expected.md @@ -21,7 +21,9 @@ export interface User { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterfaceWithDeprecatedTag.invalid.ts:9:4 - error: `@gqlImplements` has been deprecated. Instead use `interface MyType extends MyInterface`. 9 * @gqlImplements Person diff --git a/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md index 745ae9e0..264b1a46 100644 --- a/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts.expected.md @@ -10,7 +10,9 @@ export default interface Query { ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_interface/QueryFromInterface.invalid.ts:2:26 - error: Operation types `Query`, `Mutation`, and `Subscription` must be defined as type aliases of `unknown`. E.g. `type Query = unknown`. This is because GraphQL servers do not have an agreed upon way to produce root values, and Grats errs on the side of safety. If you are trying to implement dependency injection, consider using the `context` argument passed to each resolver instead. If you have a strong use case for a concrete root value, please file an issue. 2 export default interface Query { diff --git a/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md index 069d6e79..a01c1bd8 100644 --- a/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts.expected.md @@ -7,7 +7,9 @@ function MyFunc() {} ## Output -``` +### Error Report + +```text src/tests/fixtures/type_definitions_from_interface/TagAttachedToWrongNode.invalid.ts:1:5 - error: `@gqlType` can only be used on class, interface or type declarations. e.g. `class MyType {}` 1 /** @gqlType */ diff --git a/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md b/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md index bf927a6c..3aa92133 100644 --- a/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts.expected.md @@ -16,7 +16,9 @@ export interface IPerson { ## Output -``` +### Error Report + +```text src/tests/fixtures/typename/ImplementorMissingTypename.invalid.ts:2:7 - error: Cannot resolve typename. The type `User` implements `IPerson`, so it must either have a `__typename` property or be an exported class. 2 class User implements IPerson { diff --git a/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md b/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md index 28e8e8f5..725c5406 100644 --- a/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/MethodTypename.invalid.ts.expected.md @@ -13,7 +13,9 @@ class User { ## Output -``` +### Error Report + +```text src/tests/fixtures/typename/MethodTypename.invalid.ts:3:3 - error: Expected `__typename` to be a property declaration. For example: `__typename: "MyType"`. 3 __typename() { diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md index 2a23f3fb..5f4bc728 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md @@ -17,15 +17,18 @@ export interface IPerson { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts:3:15 - error: Expected `__typename` property to be `"User"`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename: "Group"; ~~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` type" (fix-typename-type) --- Code Action: "Create Grats-compatible `__typename` type" (fix-typename-type) -- +```diff - Original + Fixed @@ -34,11 +37,17 @@ src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts:3: - __typename: "Group"; + __typename: "User"; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User implements IPerson { __typename: "User"; diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md index a84a7b21..fe53f6d8 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md @@ -17,15 +17,18 @@ export interface IPerson { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts:3:3 - error: Expected `__typename` property to have an initializer or a string literal type. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename; ~~~~~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -34,11 +37,17 @@ src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts:3:3 - __typename; + __typename = "User" as const; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User implements IPerson { __typename = "User" as const; diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md index 580a0346..f73f7745 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md @@ -17,15 +17,18 @@ export interface IPerson { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts:3:15 - error: Expected `__typename` property signature to specify the typename as a string literal string type. For example `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename: string; ~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` type" (fix-typename-type) --- Code Action: "Create Grats-compatible `__typename` type" (fix-typename-type) -- +```diff - Original + Fixed @@ -34,11 +37,17 @@ src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts:3 - __typename: string; + __typename: "User"; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User implements IPerson { __typename: "User"; diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md index 2644b783..6e28fbbf 100644 --- a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md @@ -11,15 +11,18 @@ export class User { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts:3:16 - error: Expected `__typename` property initializer to be `"User"`, found `"Group"`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename = "Group" as const; ~~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -28,11 +31,17 @@ src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts:3:1 - __typename = "Group" as const; + __typename = "User" as const; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User { __typename = "User" as const; diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md index f6a27d3d..ed58ada2 100644 --- a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md @@ -11,15 +11,18 @@ export class UserModel { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts:3:16 - error: Expected `__typename` property initializer to be `"User"`, found `"UserModel"`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename = "UserModel" as const; ~~~~~~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -28,11 +31,17 @@ src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts: - __typename = "UserModel" as const; + __typename = "User" as const; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType User */ export class UserModel { __typename = "User" as const; diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md index 0e2ddf1e..dd8c5e51 100644 --- a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md @@ -11,15 +11,18 @@ export class User { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts:3:16 - error: Expected `__typename` property initializer to be an expression with a const assertion. For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename = "User"; ~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -28,11 +31,17 @@ src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid. - __typename = "User"; + __typename = "User" as const; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User { __typename = "User" as const; diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md index a77d4ed5..714f8615 100644 --- a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md @@ -13,15 +13,18 @@ type Foo = string; ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts:3:26 - error: Expected `__typename` property type name to be "const". For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename = "User" as Foo; ~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -30,11 +33,17 @@ src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.i - __typename = "User" as Foo; + __typename = "User" as const; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User { __typename = "User" as const; diff --git a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md index 19046b71..ea32d245 100644 --- a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md @@ -11,15 +11,18 @@ export class User { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts:3:15 - error: Expected `__typename` property signature to specify the typename as a string literal string type. For example `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename: string; ~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` type" (fix-typename-type) --- Code Action: "Create Grats-compatible `__typename` type" (fix-typename-type) -- +```diff - Original + Fixed @@ -28,11 +31,17 @@ src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts:3:15 - erro - __typename: string; + __typename: "User"; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User { __typename: "User"; diff --git a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md index 5e406359..ae4dcc86 100644 --- a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md @@ -11,15 +11,18 @@ export class User { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts:3:16 - error: Expected `__typename` property initializer to be a string literal. For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 3 __typename = 1 as const; ~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -28,11 +31,17 @@ src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts:3:16 - __typename = 1 as const; + __typename = "User" as const; /** @gqlField */ +``` + +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export class User { __typename = "User" as const; diff --git a/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md b/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md index 729176e7..716380dd 100644 --- a/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts.expected.md @@ -19,7 +19,9 @@ export type MyUnion = User | Group; ## Output -``` +### Error Report + +```text src/tests/fixtures/typename/UnionMemberMissingTypename.invalid.ts:8:7 - error: Cannot resolve typename. The type `Group` is a member of `MyUnion`, so it must either have a `__typename` property or be an exported class. 8 class Group { diff --git a/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md index 37d4eb23..231de50e 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts.expected.md @@ -25,7 +25,9 @@ type Actor = User | Entity; ## Output -``` +### Error Report + +```text src/tests/fixtures/unions/DefineUnionTypeContainingInterface.invalid.ts:20:21 - error: Union type Actor can only include Object types, it cannot include Entity. 20 type Actor = User | Entity; diff --git a/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md index ff88fc5a..adfee77b 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts.expected.md @@ -24,7 +24,9 @@ type Actor = User | Entity; ## Output -``` +### Error Report + +```text src/tests/fixtures/unions/DefineUnionTypeReferencingInputType.invalid.ts:19:21 - error: Union type Actor can only include Object types, it cannot include Entity. 19 type Actor = User | Entity; diff --git a/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md index cd277623..7200870a 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts.expected.md @@ -19,7 +19,9 @@ type Actor = User | "LOL"; ## Output -``` +### Error Report + +```text src/tests/fixtures/unions/DefineUnionTypeReferencingLiteral.invalid.ts:14:21 - error: Expected `@gqlUnion` union members to be type references. Grats expects union members to be references to something annotated with `@gqlType`. If you think Grats should be able to infer this union member, please report an issue at https://github.com/captbaritone/grats/issues. diff --git a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md index 08e321b1..53452b46 100644 --- a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md @@ -27,8 +27,9 @@ type Actor = User | Entity | Actor; ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts:9:16 - error: Expected `__typename` property initializer to be an expression with a const assertion. For example: `__typename = "User" as const` or `__typename: "User";`. This is needed to ensure Grats can determine the type of this object during GraphQL execution. 9 __typename = "User"; @@ -38,9 +39,11 @@ src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts:16:16 - error: Expect 16 __typename = "Entity"; ~~~~~~~~ +``` +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +```diff - Original + Fixed @@ -49,7 +52,11 @@ src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts:16:16 - error: Expect - __typename = "User"; + __typename = "User" as const; /** @gqlField */ --- Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) -- +``` + +#### Code Action: "Create Grats-compatible `__typename` property" (fix-typename-property) + +```diff - Original + Fixed @@ -58,12 +65,18 @@ src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts:16:16 - error: Expect - __typename = "Entity"; + __typename = "Entity" as const; /** @gqlField */ +``` --- Applied Fixes -- - * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts +#### Applied Fixes + +```text +* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts +``` + +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlType */ export default class SomeType { /** @gqlField */ diff --git a/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md b/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md index 2282d486..64fb7cc9 100644 --- a/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts.expected.md @@ -37,7 +37,9 @@ type Actor = Admin | Foo; ## Output -``` +### Error Report + +```text src/tests/fixtures/unions/UnionAsMemberOfOtherUnion.invalid.ts:32:22 - error: Union type Actor can only include Object types, it cannot include Foo. 32 type Actor = Admin | Foo; diff --git a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md index 70dc52d6..c2cfb8eb 100644 --- a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md @@ -13,8 +13,9 @@ type Foo = { ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts:3:4 - error: Unexpected duplicate `@oneOf` tag. Grats does not accept multiple instances of the same tag. 3 * @oneOf @@ -28,8 +29,11 @@ src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts:3:4 - error: Unexpect 5 */ ~ Additional tag +``` + +#### Code Action: "Remove duplicate @oneOf tag" (remove-duplicate-tag) --- Code Action: "Remove duplicate @oneOf tag" (remove-duplicate-tag) -- +```diff - Original + Fixed @@ -39,11 +43,17 @@ src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts:3:4 - error: Unexpect - */ + * */ type Foo = { +``` + +#### Applied Fixes + +```text +* Applied fix "Remove duplicate @oneOf tag" in grats/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Remove duplicate @oneOf tag" in grats/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** * @gqlInput * @oneOf diff --git a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md index 47c8fb3e..10c1e330 100644 --- a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md @@ -6,25 +6,33 @@ ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts:1:6 - error: `@gqlFiled` is not a valid Grats tag. Valid tags are: `@gqlType`, `@gqlField`, `@gqlScalar`, `@gqlInterface`, `@gqlEnum`, `@gqlUnion`, `@gqlInput`, `@gqlDirective`, `@gqlAnnotate`, `@gqlQueryField`, `@gqlMutationField`, `@gqlSubscriptionField`. 1 /** @gqlFiled */ ~~~~~~~~ +``` +#### Code Action: "Change to @gqlField" (change-to-gqlField) --- Code Action: "Change to @gqlField" (change-to-gqlField) -- +```diff - Original + Fixed - /** @gqlFiled */ + /** @gqlField */ +``` + +#### Applied Fixes +```text +* Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlField */ ``` \ No newline at end of file diff --git a/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md b/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md index 6d586fc6..769ca0e9 100644 --- a/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/InvalidSyntax.invalid.ts.expected.md @@ -9,7 +9,9 @@ class #Foo { ## Output -``` +### Error Report + +```text src/tests/fixtures/user_error/InvalidSyntax.invalid.ts:2:7 - error TS1005: '{' expected. 2 class #Foo { diff --git a/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md b/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md index b6733f74..3f64487c 100644 --- a/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts.expected.md @@ -13,7 +13,9 @@ type Foo = { ## Output -``` +### Error Report + +```text src/tests/fixtures/user_error/KillsParentOnExceptionOnNonField.invalid.ts:1:6 - error: Unexpected `@killsParentOnException`. `@killsParentOnException` can only be used in field annotation docblocks. Perhaps you are missing a `@gqlField` tag? 1 /** @killsParentOnException */ diff --git a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md index f6fb69dc..30be11d3 100644 --- a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md @@ -7,15 +7,18 @@ function field() {} ## Output -``` --- Error Report -- +### Error Report + +```text src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts:1:6 - error: Incorrect casing for Grats tag `@GQLField`. Use `@gqlField` instead. 1 /** @GQLField */ ~~~~~~~~ +``` +#### Code Action: "Change to @gqlField" (fix-grats-tag-casing) --- Code Action: "Change to @gqlField" (fix-grats-tag-casing) -- +```diff - Original + Fixed @@ -23,11 +26,17 @@ src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts:1:6 - error: Incorrect - /** @GQLField */ + /** @gqlField */ function field() {} +``` + +#### Applied Fixes + +```text +* Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts +``` --- Applied Fixes -- - * Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts +#### Fixed Text --- Fixed Text -- +```typescript /** @gqlField */ function field() {} ``` \ No newline at end of file diff --git a/src/tests/test.ts b/src/tests/test.ts index 8b42c4a1..b14ef395 100644 --- a/src/tests/test.ts +++ b/src/tests/test.ts @@ -1,5 +1,5 @@ import * as path from "path"; -import TestRunner from "./TestRunner"; +import TestRunner, { Transformer, TransformerResult } from "./TestRunner"; import { buildSchemaAndDocResult, buildSchemaAndDocResultWithHost, @@ -32,6 +32,7 @@ import { extend } from "../utils/helpers"; import { Result, ok, err } from "../utils/Result"; import { applyFixes } from "../fixFixable"; import { writeTypeScriptTypeToDisk } from "../../scripts/buildConfigTypes"; +import { Markdown } from "./Markdown"; writeTypeScriptTypeToDisk(); @@ -80,7 +81,14 @@ const fixturesDir = path.join(__dirname, "fixtures"); const configFixturesDir = path.join(__dirname, "configParserFixtures"); const integrationFixturesDir = path.join(__dirname, "integrationFixtures"); -const testDirs = [ +type TestDir = { + fixturesDir: string; + testFilePattern: RegExp; + ignoreFilePattern: RegExp | null; + transformer: Transformer; +}; + +const testDirs: TestDir[] = [ { fixturesDir: configFixturesDir, testFilePattern: /\.json$/, @@ -130,10 +138,7 @@ const testDirs = [ fixturesDir, testFilePattern: /\.ts$/, ignoreFilePattern: null, - transformer: ( - code: string, - fileName: string, - ): Result | false => { + transformer: (code: string, fileName: string): TransformerResult => { const firstLine = code.split("\n")[0]; let config: Partial = { nullableByDefault: true, @@ -385,7 +390,7 @@ function printSDLFromSchemaWithoutDirectives(schema: GraphQLSchema): string { function formatDiagnosticsWithContext( code: string, diagnostics: ReportableDiagnostics, -): string { +): Markdown { const formatted = diagnostics.formatDiagnosticsWithContext(); const actions: { @@ -435,8 +440,12 @@ function formatDiagnosticsWithContext( }); } + const markdown = new Markdown(); + markdown.addHeader(3, "Error Report"); + markdown.addCodeBlock(formatted, "text"); + if (actions.length === 0) { - return formatted; + return markdown; } const fixable = diagnostics._diagnostics.filter((d) => d.fix != null); @@ -445,7 +454,13 @@ function formatDiagnosticsWithContext( logEvents.push(event); } - let fixedText = ""; + for (const action of actions) { + markdown.addHeader( + 4, + `Code Action: "${action.description}" (${action.fixName})`, + ); + markdown.addCodeBlock(action.diff, "diff"); + } if (fixable.length > 0) { const fileName = fixable[0].file?.fileName; @@ -459,16 +474,13 @@ function formatDiagnosticsWithContext( writeFileSync(fileName, current, "utf8"); - fixedText = `\n\n-- Applied Fixes --\n${logEvents.join("\n")}\n\n-- Fixed Text --\n${newText}`; + markdown.addHeader(4, "Applied Fixes"); + markdown.addCodeBlock(logEvents.join("\n"), "text"); + markdown.addHeader(4, "Fixed Text"); + markdown.addCodeBlock(newText, "typescript"); } - const actionText = actions - .map((action) => { - return `-- Code Action: "${action.description}" (${action.fixName}) --\n${action.diff}`; - }) - .join("\n"); - - return `-- Error Report --\n${formatted}\n${actionText}${fixedText}`; + return markdown; } program.parse(); From 1192915e24b5a1d09223912513e29126e688434b Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Wed, 10 Dec 2025 07:52:45 -0800 Subject: [PATCH 4/6] More markdown formatting for test errors --- .../invlaidKey.invalid.json.expected.md | 4 ++- ...ultiLineNonHeader.invalid.json.expected.md | 4 ++- ...llableFieldIsNull.invalid.json.expected.md | 4 ++- .../locate/genericType.invalid.ts.expected.md | 4 ++- .../genericTypeField.invalid.ts.expected.md | 4 ++- .../locate/inputType.invalid.ts.expected.md | 4 ++- .../inputTypeField.invalid.ts.expected.md | 4 ++- .../locate/interface.invalid.ts.expected.md | 4 ++- .../locate/type.invalid.ts.expected.md | 4 ++- .../locate/typeField.invalid.ts.expected.md | 4 ++- src/tests/test.ts | 27 +++++++++++++------ 11 files changed, 49 insertions(+), 18 deletions(-) diff --git a/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md b/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md index 7234c57a..85461389 100644 --- a/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md +++ b/src/tests/configParserFixtures/invlaidKey.invalid.json.expected.md @@ -8,6 +8,8 @@ ## Output -``` +### Error Report + +```text error: Unknown Grats config option `lol`. ``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md b/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md index 872fce52..364d89b8 100644 --- a/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md +++ b/src/tests/configParserFixtures/multiLineNonHeader.invalid.json.expected.md @@ -8,6 +8,8 @@ ## Output -``` +### Error Report + +```text error: Expected property `tsSchema` to be a string, but got ["/path/","to/","schema.ts"]. ``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md b/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md index b6329517..a44e0528 100644 --- a/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md +++ b/src/tests/configParserFixtures/nonNullableFieldIsNull.invalid.json.expected.md @@ -8,6 +8,8 @@ ## Output -``` +### Error Report + +```text error: The Grats config option `importModuleSpecifierEnding` must be a `string` if provided. ``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/genericType.invalid.ts.expected.md b/src/tests/fixtures/locate/genericType.invalid.ts.expected.md index fac772ce..13c078a0 100644 --- a/src/tests/fixtures/locate/genericType.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/genericType.invalid.ts.expected.md @@ -40,7 +40,9 @@ type PageInfo = { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/genericType.invalid.ts:20:10 - error: Located here 20 edges: Edge[]; diff --git a/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md b/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md index db3c2ad2..68d77c0a 100644 --- a/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/genericTypeField.invalid.ts.expected.md @@ -40,7 +40,9 @@ type PageInfo = { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/genericTypeField.invalid.ts:14:3 - error: Located here 14 cursor: string; diff --git a/src/tests/fixtures/locate/inputType.invalid.ts.expected.md b/src/tests/fixtures/locate/inputType.invalid.ts.expected.md index 363847d1..af6ff66e 100644 --- a/src/tests/fixtures/locate/inputType.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/inputType.invalid.ts.expected.md @@ -10,7 +10,9 @@ type User = { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/inputType.invalid.ts:3:6 - error: Located here 3 type User = { diff --git a/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md b/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md index 79f78c07..86ced5e6 100644 --- a/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/inputTypeField.invalid.ts.expected.md @@ -10,7 +10,9 @@ type User = { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/inputTypeField.invalid.ts:4:3 - error: Located here 4 name: string; diff --git a/src/tests/fixtures/locate/interface.invalid.ts.expected.md b/src/tests/fixtures/locate/interface.invalid.ts.expected.md index 36cef52e..ab1942a1 100644 --- a/src/tests/fixtures/locate/interface.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/interface.invalid.ts.expected.md @@ -11,7 +11,9 @@ interface Person { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/interface.invalid.ts:3:11 - error: Located here 3 interface Person { diff --git a/src/tests/fixtures/locate/type.invalid.ts.expected.md b/src/tests/fixtures/locate/type.invalid.ts.expected.md index 5de03a66..d8831e2e 100644 --- a/src/tests/fixtures/locate/type.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/type.invalid.ts.expected.md @@ -11,7 +11,9 @@ type User = { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/type.invalid.ts:3:6 - error: Located here 3 type User = { diff --git a/src/tests/fixtures/locate/typeField.invalid.ts.expected.md b/src/tests/fixtures/locate/typeField.invalid.ts.expected.md index adbdae81..30ab5e42 100644 --- a/src/tests/fixtures/locate/typeField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/typeField.invalid.ts.expected.md @@ -11,7 +11,9 @@ type User = { ## Output -``` +### Error Report + +```text src/tests/fixtures/locate/typeField.invalid.ts:5:3 - error: Located here 5 name: string; diff --git a/src/tests/test.ts b/src/tests/test.ts index b14ef395..02792040 100644 --- a/src/tests/test.ts +++ b/src/tests/test.ts @@ -93,7 +93,10 @@ const testDirs: TestDir[] = [ fixturesDir: configFixturesDir, testFilePattern: /\.json$/, ignoreFilePattern: null, - transformer: (code: string, _fileName: string): Result => { + transformer: ( + code: string, + _fileName: string, + ): Result => { const config = JSON.parse(code); let parsed: ParsedCommandLineGrats; const warnings: string[] = []; @@ -112,9 +115,10 @@ const testDirs: TestDir[] = [ }); if (parsedResult.kind === "ERROR") { return err( - ReportableDiagnostics.fromDiagnostics( - parsedResult.err, - ).formatDiagnosticsWithContext(), + formatDiagnosticsWithContext( + code, + ReportableDiagnostics.fromDiagnostics(parsedResult.err), + ), ); } parsed = parsedResult.value; @@ -229,9 +233,12 @@ const testDirs: TestDir[] = [ } return err( - new ReportableDiagnostics(compilerHost, [ - gqlErr({ loc: locResult.value }, "Located here"), - ]).formatDiagnosticsWithContext(), + formatDiagnosticsWithContext( + code, + new ReportableDiagnostics(compilerHost, [ + gqlErr({ loc: locResult.value }, "Located here"), + ]), + ), ); } else { const docSansDirectives = { @@ -261,7 +268,7 @@ const testDirs: TestDir[] = [ transformer: async ( code: string, fileName: string, - ): Promise | false> => { + ): Promise | false> => { const firstLine = code.split("\n")[0]; let config: Partial = { nullableByDefault: true, @@ -289,6 +296,8 @@ const testDirs: TestDir[] = [ fileNames: files, }); if (parsedOptionsResult.kind === "ERROR") { + // We don't expect integration tests to error during config parsing + // so we throw here instead of returning a Markdown result. throw new Error( ReportableDiagnostics.fromDiagnostics( parsedOptionsResult.err, @@ -298,6 +307,8 @@ const testDirs: TestDir[] = [ const parsedOptions = parsedOptionsResult.value; const schemaResult = buildSchemaAndDocResult(parsedOptions); if (schemaResult.kind === "ERROR") { + // We don't expect integration tests to error GraphQL schema building + // so we throw here instead of returning a Markdown result. throw new Error( ReportableDiagnostics.fromDiagnostics( schemaResult.err, From 56500764677da77cffc447ed52e8a0b2d0b8162d Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Wed, 10 Dec 2025 08:04:14 -0800 Subject: [PATCH 5/6] Complete migration to markdown snapshots --- src/tests/TestRunner.ts | 2 +- .../empty.json.expected.md | 5 ++- .../experimentalField.json.expected.md | 11 ++++-- .../multiLineHeader.json.expected.md | 5 ++- .../ArgumentWithDescription.ts.expected.md | 11 ++++-- .../CustomScalarArgument.ts.expected.md | 11 ++++-- .../DeprecatedArgument.ts.expected.md | 11 ++++-- .../GqlTypeUsedAsPositionalArg.ts.expected.md | 11 ++++-- .../NullableArguments.ts.expected.md | 11 ++++-- .../arguments/OptionalArgument.ts.expected.md | 11 ++++-- ...NullableArgumentWithDefault.ts.expected.md | 11 ++++-- ...tionalArgDeprecatedOptional.ts.expected.md | 11 ++++-- ...nalArgDeprecatedWithDefault.ts.expected.md | 11 ++++-- .../PositionalArgOptional.ts.expected.md | 11 ++++-- .../PositionalArgWithDefault.ts.expected.md | 11 ++++-- ...ositionalArgWithDescription.ts.expected.md | 11 ++++-- .../arguments/StringArgument.ts.expected.md | 11 ++++-- .../FloatField.ts.expected.md | 11 ++++-- .../FloatFieldAliasedImport.ts.expected.md | 11 ++++-- .../built_in_scalars/IdField.ts.expected.md | 11 ++++-- .../built_in_scalars/IntField.ts.expected.md | 11 ++++-- ...importModuleSpecifierEnding.ts.expected.md | 11 ++++-- .../DefineCustomScalar.ts.expected.md | 11 ++++-- ...CustomScalarWithDescription.ts.expected.md | 11 ++++-- .../DefineRenamedCustomScalar.ts.expected.md | 11 ++++-- .../custom_scalars/SpecifiedBy.ts.expected.md | 11 ++++-- .../DefaultArgumentArray.ts.expected.md | 11 ++++-- ...faultArgumentBooleanLiteral.ts.expected.md | 11 ++++-- .../DefaultArgumentNullLiteral.ts.expected.md | 11 ++++-- ...efaultArgumentNumberLiteral.ts.expected.md | 11 ++++-- ...efaultArgumentObjectLiteral.ts.expected.md | 11 ++++-- ...DefaultArgumentPropertyName.ts.expected.md | 11 ++++-- ...efaultArgumentStringLiteral.ts.expected.md | 11 ++++-- ...umentStringLiteralBackticks.ts.expected.md | 11 ++++-- ...vedContextUsedMultipleTimes.ts.expected.md | 11 ++++-- .../simpleDerivedContext.ts.expected.md | 11 ++++-- .../simpleDerivedContextNoArgs.ts.expected.md | 11 ++++-- ...BlankLinesAroundDescription.ts.expected.md | 11 ++++-- .../BlankLinesFollowTypeTag.ts.expected.md | 11 ++++-- .../MultilineDescription.ts.expected.md | 11 ++++-- .../defineCustomDirective.ts.expected.md | 11 ++++-- ...iveAdditionalArgsAreIgnored.ts.expected.md | 11 ++++-- ...eCustomDirectiveArgsIsNever.ts.expected.md | 11 ++++-- ...neCustomDirectiveCustomName.ts.expected.md | 11 ++++-- ...mDirectiveMultipleLocations.ts.expected.md | 11 ++++-- ...neCustomDirectiveRepeatable.ts.expected.md | 11 ++++-- ...fineCustomDirectiveWithArgs.ts.expected.md | 11 ++++-- ...mDirectiveWithArgsNonScalar.ts.expected.md | 11 ++++-- ...irectiveWithArgsWithDefault.ts.expected.md | 11 ++++-- ...eIsStringLiteralWithDefault.ts.expected.md | 11 ++++-- ...rectiveOnArgumentDefinition.ts.expected.md | 11 ++++-- .../directives/directiveOnEnum.ts.expected.md | 11 ++++-- .../directiveOnEnumValue.ts.expected.md | 11 ++++-- .../directiveOnFieldDefinition.ts.expected.md | 11 ++++-- ...ctiveOnInputFieldDefinition.ts.expected.md | 11 ++++-- .../directiveOnInputObjectType.ts.expected.md | 11 ++++-- .../directiveOnInterface.ts.expected.md | 11 ++++-- .../directiveOnObjectType.ts.expected.md | 11 ++++-- .../directiveOnScalar.ts.expected.md | 11 ++++-- .../directiveOnUnion.ts.expected.md | 11 ++++-- ...gqlAnnotateOnNonGqlDocblock.ts.expected.md | 9 ++++- ...definedDirectiveWithoutArgs.ts.expected.md | 11 ++++-- .../DeprecatedEnumVariant.ts.expected.md | 11 ++++-- src/tests/fixtures/enums/Enum.ts.expected.md | 11 ++++-- .../enums/EnumFromUnionType.ts.expected.md | 11 ++++-- ...romUnionTypeOfStringLiteral.ts.expected.md | 11 ++++-- ...romUnionTypeWithDescription.ts.expected.md | 11 ++++-- ...numValuesDifferentThanNames.ts.expected.md | 11 ++++-- .../enums/EnumWithDescription.ts.expected.md | 11 ++++-- ...mWithVariantWithDescription.ts.expected.md | 11 ++++-- .../enums/NonNullEnumDefault.ts.expected.md | 11 ++++-- ...ullEnumDefaultInInputObject.ts.expected.md | 11 ++++-- .../NonNullPluralEnumDefaults.ts.expected.md | 11 ++++-- .../enums/NonNullTsEnumDefault.ts.expected.md | 11 ++++-- ...lTsEnumDefaultStringLiteral.ts.expected.md | 11 ++++-- .../examples/playground.ts.expected.md | 11 ++++-- .../fixtures/examples/readme.ts.expected.md | 11 ++++-- .../addStringFieldToInterface.ts.expected.md | 11 ++++-- ...rfaceImplementedByInterface.ts.expected.md | 11 ++++-- .../addDeprecatedField.ts.expected.md | 11 ++++-- .../addFieldWithArguments.ts.expected.md | 11 ++++-- .../addFieldWithDescription.ts.expected.md | 11 ++++-- .../addRenamedFieldToSomeType.ts.expected.md | 11 ++++-- .../addStringFieldToSomeType.ts.expected.md | 11 ++++-- .../extend_type/defaultExport.ts.expected.md | 11 ++++-- ...ieldAsExportedArrowFunction.ts.expected.md | 11 ++++-- ...ArrowFunctionPositionalArgs.ts.expected.md | 11 ++++-- ...sExportedAsyncArrowFunction.ts.expected.md | 11 ++++-- ...dOnTypeDefinedWithInterface.ts.expected.md | 11 ++++-- .../interfaceFirstArgumentType.ts.expected.md | 11 ++++-- .../optionalModelType.ts.expected.md | 11 ++++-- .../DeprecatedMethodField.ts.expected.md | 11 ++++-- .../DeprecatedPropertyField.ts.expected.md | 11 ++++-- .../FieldAsStaticClassMethod.ts.expected.md | 11 ++++-- ...ticClassMethodOnNonGqlClass.ts.expected.md | 11 ++++-- ...sMethodOnUnnamedNonGqlClass.ts.expected.md | 11 ++++-- ...hodWithClassAsDefaultExport.ts.expected.md | 11 ++++-- .../GetAcessorField.ts.expected.md | 11 ++++-- .../MethodSignatureOnInterface.ts.expected.md | 11 ++++-- ...eFieldsAsStaticClassMethods.ts.expected.md | 11 ++++-- .../ParameterPropertyField.ts.expected.md | 11 ++++-- ...eterPropertyFieldDeprecated.ts.expected.md | 11 ++++-- ...ameterPropertyFieldReadOnly.ts.expected.md | 11 ++++-- ...rameterPropertyFieldRenamed.ts.expected.md | 11 ++++-- ...ropertyFieldWithDescription.ts.expected.md | 11 ++++-- .../PublicFieldMethod.ts.expected.md | 11 ++++-- .../RenamedField.ts.expected.md | 11 ++++-- .../RenamedFieldWithArgs.ts.expected.md | 11 ++++-- ...RenamedFieldWithDescription.ts.expected.md | 11 ++++-- .../StringFieldWithDescription.ts.expected.md | 11 ++++-- .../field_values/ArrayField.ts.expected.md | 11 ++++-- .../ArrayOfPromises.ts.expected.md | 11 ++++-- .../ArrayShorthandField.ts.expected.md | 11 ++++-- .../ArrayWithNullableItems.ts.expected.md | 11 ++++-- .../AsyncPromiseField.ts.expected.md | 11 ++++-- .../field_values/BooleanField.ts.expected.md | 11 ++++-- .../field_values/CustomScalar.ts.expected.md | 11 ++++-- .../field_values/KitchenSink.ts.expected.md | 11 ++++-- .../field_values/LinkedField.ts.expected.md | 11 ++++-- .../LinkedFieldWithTypeArg.ts.expected.md | 11 ++++-- .../field_values/MaybePromise.ts.expected.md | 11 ++++-- .../OptionalFields.ts.expected.md | 11 ++++-- .../OptionalProperty.ts.expected.md | 11 ++++-- .../ParenthesizedType.ts.expected.md | 11 ++++-- .../PromiseOfPromise.ts.expected.md | 11 ++++-- .../ReadonlyArrayField.ts.expected.md | 11 ++++-- .../field_values/RenamedType.ts.expected.md | 11 ++++-- .../RenamedTypeOutOfOrder.ts.expected.md | 11 ++++-- .../field_values/StringField.ts.expected.md | 11 ++++-- ...FieldKillsParentOnException.ts.expected.md | 11 ++++-- .../field_values/UnionField.ts.expected.md | 11 ++++-- .../NonNullablePromise.ts.expected.md | 11 ++++-- .../NullablePromise.ts.expected.md | 11 ++++-- .../complexMutualReferences.ts.expected.md | 11 ++++-- .../generics/connection.ts.expected.md | 11 ++++-- .../connectionEdgeAsGeneric.ts.expected.md | 11 ++++-- .../defineFieldOnGeneric.ts.expected.md | 11 ++++-- .../fixtures/generics/edge.ts.expected.md | 11 ++++-- .../generics/genericInputType.ts.expected.md | 11 ++++-- .../generics/genericInterface.ts.expected.md | 11 ++++-- .../generics/genericOverArg.ts.expected.md | 11 ++++-- ...nericReferencedMoreThanOnce.ts.expected.md | 11 ++++-- .../genericTypeUsingClass.ts.expected.md | 11 ++++-- .../genericTypeUsingInterface.ts.expected.md | 11 ++++-- .../generics/multiparamGeneric.ts.expected.md | 11 ++++-- .../names/skippedTypeParam.ts.expected.md | 11 ++++-- ...ippedTypeParamPassesLiteral.ts.expected.md | 11 ++++-- .../fixtures/generics/result.ts.expected.md | 11 ++++-- ...larPassedAsNonGqlGenericArg.ts.expected.md | 11 ++++-- .../generics/scalarWithGeneric.ts.expected.md | 11 ++++-- .../genericTypeMemberOfUnion.ts.expected.md | 11 ++++-- .../headers/customHeaders.ts.expected.md | 11 ++++-- .../headers/multilineHeader.ts.expected.md | 11 ++++-- .../oneOfFieldIsNullable.ts.expected.md | 11 ++++-- .../oneOfFieldIsOptional.ts.expected.md | 11 ++++-- .../oneOfFieldTypeList.ts.expected.md | 11 ++++-- ...neOfFieldTypeListOfNullable.ts.expected.md | 11 ++++-- .../oneOfWithFieldDescription.ts.expected.md | 11 ++++-- ...thFieldDescriptionInsideObj.ts.expected.md | 11 ++++-- .../oneOfWithTypeDescription.ts.expected.md | 11 ++++-- .../simpleOneOf.ts.expected.md | 11 ++++-- .../input_types/InputType.ts.expected.md | 11 ++++-- .../InputTypeInterface.ts.expected.md | 11 ++++-- ...tTypeInterfaceOptionalField.ts.expected.md | 11 ++++-- .../InputTypeOptionalField.ts.expected.md | 11 ++++-- ...nputTypeWithDeprecatedField.ts.expected.md | 11 ++++-- .../InputTypeWithDescription.ts.expected.md | 11 ++++-- ...putTypeWithFieldDescription.ts.expected.md | 11 ++++-- .../RenamedInputType.ts.expected.md | 11 ++++-- .../FieldReturnsInterface.ts.expected.md | 11 ++++-- .../IgnoresExtendsClause.ts.expected.md | 11 ++++-- .../ImplementsInterface.ts.expected.md | 11 ++++-- ...mentsInterfaceWithTypeParam.ts.expected.md | 11 ++++-- ...mplementsMultipleInterfaces.ts.expected.md | 11 ++++-- .../ImplementsRenamedInterface.ts.expected.md | 11 ++++-- ...finitionExtendsGqlInterface.ts.expected.md | 11 ++++-- .../InterfaceExtendsInterface.ts.expected.md | 11 ++++-- ...terfaceFieldWithDescription.ts.expected.md | 11 ++++-- ...criptionThatDiffersFromType.ts.expected.md | 11 ++++-- ...nterfaceImplementsInterface.ts.expected.md | 11 ++++-- .../InterfaceMergedIntoObject.ts.expected.md | 11 ++++-- .../InterfaceWithCustomName.ts.expected.md | 11 ++++-- ...nterfaceWithDeprecatedField.ts.expected.md | 11 ++++-- .../InterfaceWithDescription.ts.expected.md | 11 ++++-- ...tendInterfaceWithNonGqlType.ts.expected.md | 11 ++++-- .../fieldOnScalar.invalid.ts.expected.md | 4 +- ...lformedEntitySyntax.invalid.ts.expected.md | 4 +- .../notFoundField.invalid.ts.expected.md | 4 +- .../notFoundType.invalid.ts.expected.md | 4 +- .../fieldFollowedByDeprecated.ts.expected.md | 11 ++++-- ...ClassMethodWithContextValue.ts.expected.md | 11 ++++-- ...hodWithContextValueExported.ts.expected.md | 11 ++++-- .../ContextValueBeforeArgs.ts.expected.md | 11 ++++-- .../ContextValueOptional.ts.expected.md | 11 ++++-- .../ContextValueReadTwice.ts.expected.md | 11 ++++-- .../FunctionWithContextValue.ts.expected.md | 11 ++++-- ...hodsReferencingContextValue.ts.expected.md | 11 ++++-- .../ClassMethodWithInfoValue.ts.expected.md | 11 ++++-- .../FunctionWithInfoValue.ts.expected.md | 11 ++++-- .../StaticMethodWithInfoValue.ts.expected.md | 11 ++++-- .../semanticNonNull.ts.expected.md | 11 ++++-- ...nticNonNullMatchesInterface.ts.expected.md | 11 ++++-- .../semanticNull.ts.expected.md | 11 ++++-- .../InterfaceWithAsyncIterable.ts.expected.md | 11 ++++-- ...ptionClassWithAsyncIterable.ts.expected.md | 11 ++++-- ...ctionFieldWithAsyncIterable.ts.expected.md | 11 ++++-- ...eWithVariantWithDescription.ts.expected.md | 11 ++++-- .../todo/RedefineBuiltinScalar.ts.expected.md | 9 ++++- .../fixtures/todo/userExample.ts.expected.md | 11 ++++-- .../queryField.ts.expected.md | 11 ++++-- .../queryFieldOnStaticMethod.ts.expected.md | 11 ++++-- .../queryFieldRenamed.ts.expected.md | 11 ++++-- ...dWithExplicitlyDefinedQuery.ts.expected.md | 11 ++++-- .../rootFields.ts.expected.md | 11 ++++-- ...ssImplementsNonGqlInterface.ts.expected.md | 11 ++++-- .../ClassWithDescription.ts.expected.md | 11 ++++-- ...ithDescriptionAndCustomName.ts.expected.md | 11 ++++-- .../RenamedType.ts.expected.md | 11 ++++-- ...finitionImplementsInterface.ts.expected.md | 11 ++++-- ...mplementsMultipleInterfaces.ts.expected.md | 11 ++++-- .../AliasOfUnknownDefinesType.ts.expected.md | 11 ++++-- .../AliasType.ts.expected.md | 11 ++++-- .../AliasWithDescription.ts.expected.md | 11 ++++-- ...ithDescriptionAndCustomName.ts.expected.md | 11 ++++-- .../QueryAsAliasOfUnknown.ts.expected.md | 11 ++++-- .../RenamedType.ts.expected.md | 11 ++++-- .../InterfaceType.ts.expected.md | 11 ++++-- ...faceTypeExtendsGqlInterface.ts.expected.md | 11 ++++-- ...faceTypeImplementsInterface.ts.expected.md | 11 ++++-- .../InterfaceWithDescription.ts.expected.md | 11 ++++-- ...ithDescriptionAndCustomName.ts.expected.md | 11 ++++-- .../RenamedType.ts.expected.md | 11 ++++-- .../PropertySignatureTypename.ts.expected.md | 11 ++++-- .../typename/PropertyTypename.ts.expected.md | 11 ++++-- .../DefineUnionOfOneType.ts.expected.md | 11 ++++-- .../unions/DefineUnionType.ts.expected.md | 11 ++++-- ...fineUnionTypeWithInterfaces.ts.expected.md | 11 ++++-- ...neUnionTypeWithTypeLiterals.ts.expected.md | 11 ++++-- .../UnionWithDescription.ts.expected.md | 11 ++++-- .../aliasedMethod/index.ts.expected.md | 4 +- .../complexDefaultInput/index.ts.expected.md | 4 +- .../complexPlurals/index.ts.expected.md | 4 +- .../connectionExample/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../deprecated/index.ts.expected.md | 4 +- .../derivedContext/index.ts.expected.md | 4 +- .../enumDefault/index.ts.expected.md | 4 +- .../enumExport/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../functionField/index.ts.expected.md | 4 +- .../functionFieldRenamed/index.ts.expected.md | 4 +- .../getAcessor/index.ts.expected.md | 4 +- .../inputTypeOneOf/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../nonNullEnumDefault/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../numericID/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../promiseOfPromise/index.ts.expected.md | 4 +- .../resolveTypeViaClass/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- .../skipInclude/index.ts.expected.md | 4 +- .../index.ts.expected.md | 4 +- src/tests/test.ts | 37 +++++++++++++------ 268 files changed, 1982 insertions(+), 743 deletions(-) diff --git a/src/tests/TestRunner.ts b/src/tests/TestRunner.ts index 6904e356..e84f0e22 100644 --- a/src/tests/TestRunner.ts +++ b/src/tests/TestRunner.ts @@ -5,7 +5,7 @@ import { ask } from "./yesNo"; import { Result } from "../utils/Result"; import { Markdown } from "./Markdown"; -export type TransformerResult = Result | false; +export type TransformerResult = Result | false; export type Transformer = ( code: string, diff --git a/src/tests/configParserFixtures/empty.json.expected.md b/src/tests/configParserFixtures/empty.json.expected.md index 5812ed61..758dbcac 100644 --- a/src/tests/configParserFixtures/empty.json.expected.md +++ b/src/tests/configParserFixtures/empty.json.expected.md @@ -6,8 +6,9 @@ ## Output -``` --- Parsed Config -- +### Parsed Config + +```json { "graphqlSchema": "./schema.graphql", "tsSchema": "./schema.ts", diff --git a/src/tests/configParserFixtures/experimentalField.json.expected.md b/src/tests/configParserFixtures/experimentalField.json.expected.md index e40947c2..915dbe2b 100644 --- a/src/tests/configParserFixtures/experimentalField.json.expected.md +++ b/src/tests/configParserFixtures/experimentalField.json.expected.md @@ -8,8 +8,9 @@ ## Output -``` --- Parsed Config -- +### Parsed Config + +```json { "graphqlSchema": "./schema.graphql", "tsSchema": "./schema.ts", @@ -24,6 +25,10 @@ "EXPERIMENTAL__emitMetadata": true, "EXPERIMENTAL__emitResolverMap": false } --- Warnings -- +``` + +### Warnings + +```text Grats: The `EXPERIMENTAL__emitMetadata` option is experimental and will be renamed or removed in a future release. ``` \ No newline at end of file diff --git a/src/tests/configParserFixtures/multiLineHeader.json.expected.md b/src/tests/configParserFixtures/multiLineHeader.json.expected.md index 96ff7f85..1c1dafb5 100644 --- a/src/tests/configParserFixtures/multiLineHeader.json.expected.md +++ b/src/tests/configParserFixtures/multiLineHeader.json.expected.md @@ -8,8 +8,9 @@ ## Output -``` --- Parsed Config -- +### Parsed Config + +```json { "graphqlSchema": "./schema.graphql", "tsSchema": "./schema.ts", diff --git a/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md b/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md index 39cd4cf8..ca131528 100644 --- a/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md +++ b/src/tests/fixtures/arguments/ArgumentWithDescription.ts.expected.md @@ -15,15 +15,20 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello( """The greeting to use.""" greeting: String! ): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md b/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md index 9f57adcc..f4a49802 100644 --- a/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/CustomScalarArgument.ts.expected.md @@ -15,14 +15,19 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql scalar MyString type SomeType { hello(greeting: MyString!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyString as MyStringInternal } from "./CustomScalarArgument"; import { GraphQLSchema, GraphQLScalarType, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; diff --git a/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md b/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md index 1851a128..1860d784 100644 --- a/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/DeprecatedArgument.ts.expected.md @@ -17,12 +17,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String @deprecated(reason: "Not used anymore")): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md b/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md index 50cb7d29..a599d0d5 100644 --- a/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md +++ b/src/tests/fixtures/arguments/GqlTypeUsedAsPositionalArg.ts.expected.md @@ -18,8 +18,9 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting { name: String! salutation: String! @@ -28,7 +29,11 @@ input Greeting { type SomeType { hello(greeting: Greeting!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/arguments/NullableArguments.ts.expected.md b/src/tests/fixtures/arguments/NullableArguments.ts.expected.md index 88821a5b..74e6b1d5 100644 --- a/src/tests/fixtures/arguments/NullableArguments.ts.expected.md +++ b/src/tests/fixtures/arguments/NullableArguments.ts.expected.md @@ -20,13 +20,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello1(greeting: String): String hello2(greeting: String): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md b/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md index 622e60bd..e6b7fa77 100644 --- a/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalArgument.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md b/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md index 68b46516..581d1d69 100644 --- a/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalNonNullableArgumentWithDefault.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String! = "Hello"): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md index 5eca3fdd..56894526 100644 --- a/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgDeprecatedOptional.ts.expected.md @@ -21,8 +21,9 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting { name: String! salutation: String! @@ -31,7 +32,11 @@ input Greeting { type SomeType { hello(greeting: Greeting @deprecated(reason: "Unused!")): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md index 18f34b6a..54281cc1 100644 --- a/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgDeprecatedWithDefault.ts.expected.md @@ -21,8 +21,9 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting { name: String! salutation: String! @@ -31,7 +32,11 @@ input Greeting { type SomeType { hello(greeting: Greeting! = {name: "Alice", salutation: "Hullo"} @deprecated(reason: "Unused!")): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md index 60b24cd1..af68649b 100644 --- a/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgOptional.ts.expected.md @@ -18,8 +18,9 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting { name: String! salutation: String! @@ -28,7 +29,11 @@ input Greeting { type SomeType { hello(greeting: String): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md index b8427167..267e2bf2 100644 --- a/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgWithDefault.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String! = "Hello"): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md index 1536ca3e..ebf4211b 100644 --- a/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgWithDescription.ts.expected.md @@ -21,8 +21,9 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting { name: String! salutation: String! @@ -34,7 +35,11 @@ type SomeType { greeting: Greeting! ): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/arguments/StringArgument.ts.expected.md b/src/tests/fixtures/arguments/StringArgument.ts.expected.md index 0dd2c4ce..0bc21cd9 100644 --- a/src/tests/fixtures/arguments/StringArgument.ts.expected.md +++ b/src/tests/fixtures/arguments/StringArgument.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md b/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md index 3a16ddd4..1a9166c1 100644 --- a/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/FloatField.ts.expected.md @@ -14,12 +14,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { ratio: Float } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLFloat } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md b/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md index 4127bbe1..4823e9ce 100644 --- a/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/FloatFieldAliasedImport.ts.expected.md @@ -14,12 +14,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { ratio: Float } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLFloat } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md b/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md index c40a1d27..c90ae9ca 100644 --- a/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/IdField.ts.expected.md @@ -14,12 +14,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { id: ID } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLID } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md b/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md index b3be8aed..7237f87d 100644 --- a/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md +++ b/src/tests/fixtures/built_in_scalars/IntField.ts.expected.md @@ -14,12 +14,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { age: Int } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLInt } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md b/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md index f944a162..6fd1c1e2 100644 --- a/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md +++ b/src/tests/fixtures/configOptions/importModuleSpecifierEnding.ts.expected.md @@ -17,13 +17,18 @@ export function greeting(t: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./importModuleSpecifierEnding.js"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md b/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md index 46f80b1b..5501719a 100644 --- a/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/DefineCustomScalar.ts.expected.md @@ -13,14 +13,19 @@ export type MyUrl = string; ## Output -``` --- SDL -- +### SDL + +```graphql scalar MyUrl type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyUrl as MyUrlInternal } from "./DefineCustomScalar"; import { GraphQLSchema, GraphQLScalarType, GraphQLObjectType, GraphQLString } from "graphql"; diff --git a/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md b/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md index 32795919..16088c09 100644 --- a/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/DefineCustomScalarWithDescription.ts.expected.md @@ -16,15 +16,20 @@ export type MyUrl = string; ## Output -``` --- SDL -- +### SDL + +```graphql """Use this for URLs.""" scalar MyUrl type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyUrl as MyUrlInternal } from "./DefineCustomScalarWithDescription"; import { GraphQLSchema, GraphQLScalarType, GraphQLObjectType, GraphQLString } from "graphql"; diff --git a/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md b/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md index 3d06e65a..4ffbbaa0 100644 --- a/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/DefineRenamedCustomScalar.ts.expected.md @@ -13,14 +13,19 @@ export type MyUrl = string; ## Output -``` --- SDL -- +### SDL + +```graphql scalar CustomName type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyUrl as CustomNameInternal } from "./DefineRenamedCustomScalar"; import { GraphQLSchema, GraphQLScalarType, GraphQLObjectType, GraphQLString } from "graphql"; diff --git a/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md index f97f7215..e329197c 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedBy.ts.expected.md @@ -10,10 +10,15 @@ export type UUID = string; ## Output -``` --- SDL -- +### SDL + +```graphql scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { UUID as UUIDInternal } from "./SpecifiedBy"; import { GraphQLSchema, GraphQLScalarType } from "graphql"; diff --git a/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md index 43e9c12c..ab5ded19 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentArray.ts.expected.md @@ -19,12 +19,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { someField1(inputs: [String!] = ["hello", "there"]): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLList, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md index 333a8d94..d1bbd33b 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentBooleanLiteral.ts.expected.md @@ -19,13 +19,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { someField1(greet: Boolean = false): String someField2(greet: Boolean = true): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLBoolean } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md index 963bde24..fc579cd7 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentNullLiteral.ts.expected.md @@ -18,13 +18,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { someField1(hello: String = null): String someField2(hello: String = null): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md index 1719845b..d7b214c6 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentNumberLiteral.ts.expected.md @@ -18,13 +18,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { floatField(scale: Float! = 10): String intField(count: Int! = 10): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLFloat, GraphQLInt } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md index 36e77ac2..87efdd46 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentObjectLiteral.ts.expected.md @@ -24,8 +24,9 @@ type ConnectionInput = { ## Output -``` --- SDL -- +### SDL + +```graphql input ConnectionInput { first: Int! offset: Int! @@ -34,7 +35,11 @@ input ConnectionInput { type SomeType { someField1(input: ConnectionInput = {first: 10, offset: 100}): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLInt, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const ConnectionInputType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md index c4ff8757..2a57a3db 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentPropertyName.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(if: Boolean! = false): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLBoolean } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md index f6d69ff2..1c93e44c 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentStringLiteral.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String! = "hello"): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md index dc185d59..06cb347f 100644 --- a/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md +++ b/src/tests/fixtures/default_values/DefaultArgumentStringLiteralBackticks.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello(greeting: String! = "hello"): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md b/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md index be0ab1f4..e27e7061 100644 --- a/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md +++ b/src/tests/fixtures/derived_context/derivedContextUsedMultipleTimes.ts.expected.md @@ -31,13 +31,18 @@ export function farewell(_: Query, ctx: DerivedContext): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { farewell: String greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { farewell as queryFarewellResolver, greetingContext, greeting as queryGreetingResolver } from "./derivedContextUsedMultipleTimes"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md index dce01624..95b1cd0b 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContext.ts.expected.md @@ -26,12 +26,17 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as queryGreetingResolver, createDerivedContext } from "./simpleDerivedContext"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md b/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md index 9bbf2123..61cc56d6 100644 --- a/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md +++ b/src/tests/fixtures/derived_context/simpleDerivedContextNoArgs.ts.expected.md @@ -26,12 +26,17 @@ export function greeting(_: Query, ctx: DerivedContext): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as queryGreetingResolver, createDerivedContext } from "./simpleDerivedContextNoArgs"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md b/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md index 1a1a7cd0..cba4ffeb 100644 --- a/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md +++ b/src/tests/fixtures/descriptions/BlankLinesAroundDescription.ts.expected.md @@ -30,13 +30,18 @@ class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql """Sup""" type SomeType { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md b/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md index 111eecad..2391dd5f 100644 --- a/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md +++ b/src/tests/fixtures/descriptions/BlankLinesFollowTypeTag.ts.expected.md @@ -17,12 +17,17 @@ class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md b/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md index 5e3b465b..c51920a6 100644 --- a/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md +++ b/src/tests/fixtures/descriptions/MultilineDescription.ts.expected.md @@ -17,8 +17,9 @@ class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql """ ’Twas brillig, and the slithy toves Did gyre and gimble in the wabe: @@ -28,7 +29,11 @@ All mimsy were the borogoves, type SomeType { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md index 12e03399..7f5e7c32 100644 --- a/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirective.ts.expected.md @@ -10,11 +10,16 @@ export function customDirective() {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md index 77a89b0a..93951d27 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveAdditionalArgsAreIgnored.ts.expected.md @@ -17,11 +17,16 @@ export function customDirective( ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective(someArg: String!) on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLString, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md index df626408..ce09bd0c 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveArgsIsNever.ts.expected.md @@ -17,11 +17,16 @@ export function customDirective( ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md index e6ea5625..c68e3f30 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveCustomName.ts.expected.md @@ -10,11 +10,16 @@ export function customDirective() {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @aBetterName on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md index 827a4a4a..b724491c 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveMultipleLocations.ts.expected.md @@ -10,11 +10,16 @@ function customDirective() {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective on FIELD_DEFINITION | ARGUMENT_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md index 77ffd557..0b771165 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveRepeatable.ts.expected.md @@ -10,11 +10,16 @@ function customDirective() {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective repeatable on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md index 7aa0bcf4..5474a732 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveWithArgs.ts.expected.md @@ -10,11 +10,16 @@ export function customDirective(arg: { someArg: string }) {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective(someArg: String!) on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLString, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md index bdffd51e..99f861c6 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsNonScalar.ts.expected.md @@ -15,15 +15,20 @@ export function customDirective(args: { someArg: SomeInput }) {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective(someArg: SomeInput!) on FIELD_DEFINITION input SomeInput { someField: String! } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInputObjectType, GraphQLString, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { const SomeInputType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md index 8bf3290c..b630c5d7 100644 --- a/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md +++ b/src/tests/fixtures/directives/defineCustomDirectiveWithArgsWithDefault.ts.expected.md @@ -10,11 +10,16 @@ export function customDirective({ someArg = "Hello" }: { someArg: string }) {} ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @customDirective(someArg: String! = "Hello") on FIELD_DEFINITION --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLString, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md b/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md index cddb8c5c..e11bd23c 100644 --- a/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md +++ b/src/tests/fixtures/directives/directiveArgumentNameIsStringLiteralWithDefault.ts.expected.md @@ -17,10 +17,15 @@ function defer({ ## Output -``` --- SDL -- +### SDL + +```graphql directive @defer(label: String!, if: Boolean = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLString, GraphQLBoolean, specifiedDirectives } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md b/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md index 6b6731a7..75795b5d 100644 --- a/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnArgumentDefinition.ts.expected.md @@ -21,8 +21,9 @@ export function likes(args: { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on ARGUMENT_DEFINITION @@ -30,7 +31,11 @@ type Query { """All likes in the system. Note that there is no guarantee of order.""" likes(first: Int @max(foo: 10)): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLObjectType, GraphQLString } from "graphql"; import { likes as queryLikesResolver } from "./directiveOnArgumentDefinition"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md b/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md index 8cf41010..9f2236e5 100644 --- a/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnEnum.ts.expected.md @@ -17,8 +17,9 @@ type MyEnum = "A" | "B"; ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on ENUM @@ -26,7 +27,11 @@ enum MyEnum @max(foo: 10) { A B } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLEnumType } from "graphql"; export function getSchema(): GraphQLSchema { const MyEnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md b/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md index 900059ec..4e0029b0 100644 --- a/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnEnumValue.ts.expected.md @@ -20,8 +20,9 @@ enum MyEnum { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on ENUM_VALUE @@ -29,7 +30,11 @@ enum MyEnum { A @max(foo: 10) B } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLEnumType } from "graphql"; export function getSchema(): GraphQLSchema { const MyEnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md b/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md index 93e3473c..9451b13e 100644 --- a/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnFieldDefinition.ts.expected.md @@ -20,8 +20,9 @@ export function likes(args: { first?: Int | null }): string { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on FIELD_DEFINITION @@ -29,7 +30,11 @@ type Query { """All likes in the system. Note that there is no guarantee of order.""" likes(first: Int): String @max(foo: 10) } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLObjectType, GraphQLString } from "graphql"; import { likes as queryLikesResolver } from "./directiveOnFieldDefinition"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md b/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md index dfa796cc..01aa6e6f 100644 --- a/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnInputFieldDefinition.ts.expected.md @@ -19,15 +19,20 @@ type MyType = { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on INPUT_FIELD_DEFINITION input MyType { myField: String! @max(foo: 10) } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const MyTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md b/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md index 7970699e..37f19ea8 100644 --- a/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnInputObjectType.ts.expected.md @@ -19,15 +19,20 @@ type MyType = { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on INPUT_OBJECT input MyType @max(foo: 10) { myField: String! } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const MyTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md b/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md index 498c551b..d14ca95a 100644 --- a/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnInterface.ts.expected.md @@ -20,15 +20,20 @@ interface MyInterface { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on INTERFACE interface MyInterface @max(foo: 10) { myField: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLInterfaceType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const MyInterfaceType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md b/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md index b785c87f..51a1c2ba 100644 --- a/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnObjectType.ts.expected.md @@ -20,15 +20,20 @@ type MyType = { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on OBJECT type MyType @max(foo: 10) { myField: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const MyTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md b/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md index 0d6d50f6..91e25e51 100644 --- a/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnScalar.ts.expected.md @@ -17,13 +17,18 @@ export type MyScalar = string; ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on SCALAR scalar MyScalar @max(foo: 10) --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyScalar as MyScalarInternal } from "./directiveOnScalar"; import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLScalarType } from "graphql"; diff --git a/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md b/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md index e53ff592..1fc2c020 100644 --- a/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md +++ b/src/tests/fixtures/directives/directiveOnUnion.ts.expected.md @@ -35,8 +35,9 @@ type B = { ## Output -``` --- SDL -- +### SDL + +```graphql """This is my custom directive.""" directive @max(foo: Int!) on UNION @@ -49,7 +50,11 @@ type A { type B { myField: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLNonNull, GraphQLInt, specifiedDirectives, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const AType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md b/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md index b2a89ed9..9e1d6359 100644 --- a/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md +++ b/src/tests/fixtures/directives/gqlAnnotateOnNonGqlDocblock.ts.expected.md @@ -12,10 +12,15 @@ export function foo() {} ## Output +### SDL + +```graphql + ``` --- SDL -- --- TypeScript -- +### TypeScript + +```ts import { GraphQLSchema } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md b/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md index 3cd3aeb4..690e8110 100644 --- a/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md +++ b/src/tests/fixtures/directives/undefinedDirectiveWithoutArgs.ts.expected.md @@ -12,12 +12,17 @@ export function myQueryField(): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { myQueryField: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { myQueryField as queryMyQueryFieldResolver } from "./undefinedDirectiveWithoutArgs"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md b/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md index 51ed11b5..831763b7 100644 --- a/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md +++ b/src/tests/fixtures/enums/DeprecatedEnumVariant.ts.expected.md @@ -21,8 +21,9 @@ enum Enum { ## Output -``` --- SDL -- +### SDL + +```graphql enum Enum { """Invalid enum value.""" INVALID @@ -33,7 +34,11 @@ enum Enum { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/Enum.ts.expected.md b/src/tests/fixtures/enums/Enum.ts.expected.md index 4b4633e4..6dbac6ee 100644 --- a/src/tests/fixtures/enums/Enum.ts.expected.md +++ b/src/tests/fixtures/enums/Enum.ts.expected.md @@ -16,8 +16,9 @@ enum Enum { ## Output -``` --- SDL -- +### SDL + +```graphql enum Enum { INVALID VALID @@ -26,7 +27,11 @@ enum Enum { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md index ace0dd56..7c66b4bc 100644 --- a/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionType.ts.expected.md @@ -13,8 +13,9 @@ type MyEnum = "VALID" | "INVALID"; ## Output -``` --- SDL -- +### SDL + +```graphql enum MyEnum { INVALID VALID @@ -23,7 +24,11 @@ enum MyEnum { type SomeType { hello: MyEnum } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyEnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md index ea7821ad..a8b36796 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeOfStringLiteral.ts.expected.md @@ -13,8 +13,9 @@ type MyEnum = "VALID"; ## Output -``` --- SDL -- +### SDL + +```graphql enum MyEnum { VALID } @@ -22,7 +23,11 @@ enum MyEnum { type SomeType { hello: MyEnum } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyEnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md b/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md index 3b6d9871..2e0797e8 100644 --- a/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md +++ b/src/tests/fixtures/enums/EnumFromUnionTypeWithDescription.ts.expected.md @@ -16,8 +16,9 @@ type MyEnum = "VALID" | "INVALID"; ## Output -``` --- SDL -- +### SDL + +```graphql """Hello!""" enum MyEnum { INVALID @@ -27,7 +28,11 @@ enum MyEnum { type SomeType { hello: MyEnum } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyEnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md b/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md index 81de4600..124a5002 100644 --- a/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md +++ b/src/tests/fixtures/enums/EnumValuesDifferentThanNames.ts.expected.md @@ -16,8 +16,9 @@ enum Enum { ## Output -``` --- SDL -- +### SDL + +```graphql enum Enum { INVALID VALID @@ -26,7 +27,11 @@ enum Enum { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md b/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md index bab5da33..f6c48db7 100644 --- a/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md +++ b/src/tests/fixtures/enums/EnumWithDescription.ts.expected.md @@ -20,8 +20,9 @@ enum Enum { ## Output -``` --- SDL -- +### SDL + +```graphql """World's best enum.""" enum Enum { INVALID @@ -31,7 +32,11 @@ enum Enum { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md b/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md index 1b5c2dad..03577c0a 100644 --- a/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md +++ b/src/tests/fixtures/enums/EnumWithVariantWithDescription.ts.expected.md @@ -18,8 +18,9 @@ enum Enum { ## Output -``` --- SDL -- +### SDL + +```graphql enum Enum { """Invalid enum value.""" INVALID @@ -30,7 +31,11 @@ enum Enum { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md b/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md index fb1e8879..655cd8aa 100644 --- a/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullEnumDefault.ts.expected.md @@ -14,8 +14,9 @@ export function hello(greeting: GreetingOptions = "Greetings"): string { ## Output -``` --- SDL -- +### SDL + +```graphql enum GreetingOptions { Greetings Hello @@ -25,7 +26,11 @@ enum GreetingOptions { type Query { hello(greeting: GreetingOptions! = Greetings): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLEnumType } from "graphql"; import { hello as queryHelloResolver } from "./NonNullEnumDefault"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md b/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md index 5de29e83..c3a69432 100644 --- a/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullEnumDefaultInInputObject.ts.expected.md @@ -21,8 +21,9 @@ export function hello( ## Output -``` --- SDL -- +### SDL + +```graphql enum GreetingOptions { Greetings Hello @@ -36,7 +37,11 @@ input GreetingInput { type Query { hello(input: GreetingInput! = {greeting: Greetings}): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLInputObjectType, GraphQLEnumType } from "graphql"; import { hello as queryHelloResolver } from "./NonNullEnumDefaultInInputObject"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md b/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md index a87ebabb..51dc71a4 100644 --- a/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullPluralEnumDefaults.ts.expected.md @@ -16,8 +16,9 @@ export function hello( ## Output -``` --- SDL -- +### SDL + +```graphql enum GreetingOptions { Greetings Hello @@ -27,7 +28,11 @@ enum GreetingOptions { type Query { hello(greeting: [GreetingOptions!]! = [Greetings, Hello]): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLList, GraphQLEnumType } from "graphql"; import { hello as queryHelloResolver } from "./NonNullPluralEnumDefaults"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md b/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md index f8d3b1a9..823b696b 100644 --- a/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullTsEnumDefault.ts.expected.md @@ -21,8 +21,9 @@ export function hello( ## Output -``` --- SDL -- +### SDL + +```graphql enum GreetingOptions { GREETING HELLO @@ -32,7 +33,11 @@ enum GreetingOptions { type Query { hello(greeting: GreetingOptions! = GREETING): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLEnumType } from "graphql"; import { hello as queryHelloResolver } from "./NonNullTsEnumDefault"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md b/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md index bee5f9b4..88d3da52 100644 --- a/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md +++ b/src/tests/fixtures/enums/NonNullTsEnumDefaultStringLiteral.ts.expected.md @@ -21,8 +21,9 @@ export function hello( ## Output -``` --- SDL -- +### SDL + +```graphql enum GreetingOptions { GREETING HELLO @@ -32,7 +33,11 @@ enum GreetingOptions { type Query { hello(greeting: GreetingOptions! = GREETING): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLEnumType } from "graphql"; import { hello as queryHelloResolver } from "./NonNullTsEnumDefaultStringLiteral"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/examples/playground.ts.expected.md b/src/tests/fixtures/examples/playground.ts.expected.md index 6f59e7e9..09395dbf 100644 --- a/src/tests/fixtures/examples/playground.ts.expected.md +++ b/src/tests/fixtures/examples/playground.ts.expected.md @@ -38,8 +38,9 @@ export function getUser(_: SomeType): UserResolver { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { getUser: User me: User @@ -51,7 +52,11 @@ type User { greeting(salutation: String!): String name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; import { getUser as someTypeGetUserResolver } from "./playground"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/examples/readme.ts.expected.md b/src/tests/fixtures/examples/readme.ts.expected.md index 0ce79bad..709de8ea 100644 --- a/src/tests/fixtures/examples/readme.ts.expected.md +++ b/src/tests/fixtures/examples/readme.ts.expected.md @@ -33,8 +33,9 @@ class UserResolver { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { me: User viewer: User @deprecated(reason: "Please use `me` instead.") @@ -45,7 +46,11 @@ type User { greeting(salutation: String!): String name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; import { me as queryMeResolver, viewer as queryViewerResolver } from "./readme"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md index afaa7ae6..406bf211 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToInterface.ts.expected.md @@ -32,8 +32,9 @@ class Admin implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson { greeting: String hello: String @@ -48,7 +49,11 @@ type User implements IPerson { greeting: String hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; import { greeting as adminGreetingResolver, greeting as userGreetingResolver } from "./addStringFieldToInterface"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md index ecb4e96d..d1100b04 100644 --- a/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md +++ b/src/tests/fixtures/extend_interface/addStringFieldToInterfaceImplementedByInterface.ts.expected.md @@ -37,8 +37,9 @@ class Admin implements IPerson, IThing { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson implements IThing { greeting: String } @@ -54,7 +55,11 @@ type Admin implements IPerson & IThing { type User implements IPerson & IThing { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; import { greeting as adminGreetingResolver, greeting as userGreetingResolver } from "./addStringFieldToInterfaceImplementedByInterface"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md b/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md index 55041b3f..c50b25bc 100644 --- a/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md +++ b/src/tests/fixtures/extend_type/addDeprecatedField.ts.expected.md @@ -17,12 +17,17 @@ export function greeting(query: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String @deprecated(reason: "Because reasons") } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./addDeprecatedField"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md b/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md index 64304ed5..42dab08d 100644 --- a/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md +++ b/src/tests/fixtures/extend_type/addFieldWithArguments.ts.expected.md @@ -14,12 +14,17 @@ export function greeting(_: SomeType, args: { name: string }): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting(name: String!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; import { greeting as someTypeGreetingResolver } from "./addFieldWithArguments"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md b/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md index d4c486f1..b5f72761 100644 --- a/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/extend_type/addFieldWithDescription.ts.expected.md @@ -17,13 +17,18 @@ export function greeting(_: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { """Best field ever!""" greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./addFieldWithDescription"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md b/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md index 80430be8..d3533754 100644 --- a/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md +++ b/src/tests/fixtures/extend_type/addRenamedFieldToSomeType.ts.expected.md @@ -14,12 +14,17 @@ export function greeting(_: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeHelloResolver } from "./addRenamedFieldToSomeType"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md b/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md index ecae577c..61b65962 100644 --- a/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md +++ b/src/tests/fixtures/extend_type/addStringFieldToSomeType.ts.expected.md @@ -14,12 +14,17 @@ export function greeting(_: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./addStringFieldToSomeType"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/defaultExport.ts.expected.md b/src/tests/fixtures/extend_type/defaultExport.ts.expected.md index f79703db..3b5322c7 100644 --- a/src/tests/fixtures/extend_type/defaultExport.ts.expected.md +++ b/src/tests/fixtures/extend_type/defaultExport.ts.expected.md @@ -14,12 +14,17 @@ export default function greeting(_: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import someTypeGreetingResolver from "./defaultExport"; import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md index ed784494..22ded29c 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunction.ts.expected.md @@ -14,12 +14,17 @@ export const greeting = (_: SomeType): string => { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./fieldAsExportedArrowFunction"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md index 94f6062c..5db5ac34 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedArrowFunctionPositionalArgs.ts.expected.md @@ -14,12 +14,17 @@ export const greeting = (_: SomeType, name: string): string => { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting(name: String!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; import { greeting as someTypeGreetingResolver } from "./fieldAsExportedArrowFunctionPositionalArgs"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md index 1703ef74..864cf2df 100644 --- a/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsExportedAsyncArrowFunction.ts.expected.md @@ -14,12 +14,17 @@ export const greeting = async (_: SomeType): Promise => { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./fieldAsExportedAsyncArrowFunction"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md b/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md index 41df6197..8daba666 100644 --- a/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md +++ b/src/tests/fixtures/extend_type/functionFieldOnTypeDefinedWithInterface.ts.expected.md @@ -14,12 +14,17 @@ export function catSound(obj: Cat): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Cat { catSound: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { catSound as catCatSoundResolver } from "./functionFieldOnTypeDefinedWithInterface"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md b/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md index 5f8cc0c7..b95ebfcc 100644 --- a/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md +++ b/src/tests/fixtures/extend_type/interfaceFirstArgumentType.ts.expected.md @@ -21,8 +21,9 @@ export function greeting(iFoo: IFoo): string { ## Output -``` --- SDL -- +### SDL + +```graphql interface IFoo { bar: String greeting: String @@ -31,7 +32,11 @@ interface IFoo { type SomeType { foo: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const IFooType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md b/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md index 587503e1..783f2558 100644 --- a/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md +++ b/src/tests/fixtures/extend_type/optionalModelType.ts.expected.md @@ -21,12 +21,17 @@ export function greeting( ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./optionalModelType"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md b/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md index 14f6ac3a..775bfaf9 100644 --- a/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/DeprecatedMethodField.ts.expected.md @@ -15,12 +15,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String @deprecated(reason: "Use something else.") } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md b/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md index c8d2240f..662c43e4 100644 --- a/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/DeprecatedPropertyField.ts.expected.md @@ -13,12 +13,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String @deprecated(reason: "Use something else.") } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md index 4e40b11c..36dcb724 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethod.ts.expected.md @@ -18,8 +18,9 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { getUser: User } @@ -27,7 +28,11 @@ type Query { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { User as queryGetUserResolver } from "./FieldAsStaticClassMethod"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md index 848fda10..ca5b5bb3 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnNonGqlClass.ts.expected.md @@ -14,12 +14,17 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greet: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { SomeClass as queryGreetResolver } from "./FieldAsStaticClassMethodOnNonGqlClass"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md index 3d506108..3a457161 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodOnUnnamedNonGqlClass.ts.expected.md @@ -14,12 +14,17 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greet: String } --- TypeScript -- +``` + +### TypeScript + +```ts import queryGreetResolver from "./FieldAsStaticClassMethodOnUnnamedNonGqlClass"; import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md index 403f47d3..b01bfc0f 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodWithClassAsDefaultExport.ts.expected.md @@ -18,8 +18,9 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { getUser: User } @@ -27,7 +28,11 @@ type Query { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import queryGetUserResolver from "./FieldAsStaticClassMethodWithClassAsDefaultExport"; import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md b/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md index f5844e74..fadb43b3 100644 --- a/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/GetAcessorField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md b/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md index 06ff42b2..078e56cd 100644 --- a/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md +++ b/src/tests/fixtures/field_definitions/MethodSignatureOnInterface.ts.expected.md @@ -10,12 +10,17 @@ interface ICarly { ## Output -``` --- SDL -- +### SDL + +```graphql interface ICarly { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const ICarlyType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md b/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md index 88c43c90..bbbae0fb 100644 --- a/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md +++ b/src/tests/fixtures/field_definitions/MultipleFieldsAsStaticClassMethods.ts.expected.md @@ -23,8 +23,9 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { getUser: User getUsers: [User!] @@ -33,7 +34,11 @@ type Query { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLList, GraphQLNonNull } from "graphql"; import { User as queryGetUserResolver, User as queryGetUsersResolver } from "./MultipleFieldsAsStaticClassMethods"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md index 7728a6ef..a35b1acb 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md index feb28f97..ae07634b 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldDeprecated.ts.expected.md @@ -15,12 +15,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String @deprecated(reason: "Don't use this") } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md index dc3acb24..83b249bc 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnly.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md index dccdc58d..d954c0f6 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldRenamed.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md index 342a8c95..117791c5 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldWithDescription.ts.expected.md @@ -15,13 +15,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { """Greet the world!""" hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md b/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md index b6fa3b73..0bd0834b 100644 --- a/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md +++ b/src/tests/fixtures/field_definitions/PublicFieldMethod.ts.expected.md @@ -12,12 +12,17 @@ export class User { ## Output -``` --- SDL -- +### SDL + +```graphql type User { greet: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md b/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md index 4c8480af..eba8f9f2 100644 --- a/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md +++ b/src/tests/fixtures/field_definitions/RenamedField.ts.expected.md @@ -15,13 +15,18 @@ class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String salutaion: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md b/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md index d4bcb18f..ad7c1187 100644 --- a/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md +++ b/src/tests/fixtures/field_definitions/RenamedFieldWithArgs.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greetz(greeting: String!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md b/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md index bffa7559..d9652572 100644 --- a/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/field_definitions/RenamedFieldWithDescription.ts.expected.md @@ -23,15 +23,20 @@ class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { """Number 1 greeting.""" greeting: String """Number 1 salutation.""" salutaion: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md b/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md index 7325e7ed..6635b167 100644 --- a/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/field_definitions/StringFieldWithDescription.ts.expected.md @@ -15,13 +15,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { """Greet the world!""" hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/ArrayField.ts.expected.md b/src/tests/fixtures/field_values/ArrayField.ts.expected.md index 2dde85cb..807a82bc 100644 --- a/src/tests/fixtures/field_values/ArrayField.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: [String!] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md b/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md index 265f2a83..97058eaa 100644 --- a/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayOfPromises.ts.expected.md @@ -12,13 +12,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { b: [String!] c: [String!] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md b/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md index 43905a22..45c8bd81 100644 --- a/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayShorthandField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: [String!] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md b/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md index 53e35289..495a538e 100644 --- a/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md +++ b/src/tests/fixtures/field_values/ArrayWithNullableItems.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: [String] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md b/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md index 1af1392f..8d7b006d 100644 --- a/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md +++ b/src/tests/fixtures/field_values/AsyncPromiseField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/BooleanField.ts.expected.md b/src/tests/fixtures/field_values/BooleanField.ts.expected.md index d8042e0e..e04287fa 100644 --- a/src/tests/fixtures/field_values/BooleanField.ts.expected.md +++ b/src/tests/fixtures/field_values/BooleanField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { haveBeenGreeted: Boolean } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLBoolean } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/CustomScalar.ts.expected.md b/src/tests/fixtures/field_values/CustomScalar.ts.expected.md index f19c813d..f0fec75f 100644 --- a/src/tests/fixtures/field_values/CustomScalar.ts.expected.md +++ b/src/tests/fixtures/field_values/CustomScalar.ts.expected.md @@ -15,14 +15,19 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql scalar MyString type SomeType { hello: MyString } --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyString as MyStringInternal } from "./CustomScalar"; import { GraphQLSchema, GraphQLScalarType, GraphQLObjectType } from "graphql"; diff --git a/src/tests/fixtures/field_values/KitchenSink.ts.expected.md b/src/tests/fixtures/field_values/KitchenSink.ts.expected.md index 2562d2f9..519295d3 100644 --- a/src/tests/fixtures/field_values/KitchenSink.ts.expected.md +++ b/src/tests/fixtures/field_values/KitchenSink.ts.expected.md @@ -61,8 +61,9 @@ class Group { ## Output -``` --- SDL -- +### SDL + +```graphql type Group { description: String members: [User!] @@ -81,7 +82,11 @@ type User { groups: [Group!] name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLList, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/LinkedField.ts.expected.md b/src/tests/fixtures/field_values/LinkedField.ts.expected.md index e1f67311..37b562db 100644 --- a/src/tests/fixtures/field_values/LinkedField.ts.expected.md +++ b/src/tests/fixtures/field_values/LinkedField.ts.expected.md @@ -24,8 +24,9 @@ class User { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { me: User } @@ -34,7 +35,11 @@ type User { friends: [User!] name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md b/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md index 5538735a..d0d902f1 100644 --- a/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md +++ b/src/tests/fixtures/field_values/LinkedFieldWithTypeArg.ts.expected.md @@ -26,8 +26,9 @@ class User { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { me: User } @@ -36,7 +37,11 @@ type User { friends: [User!] name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/MaybePromise.ts.expected.md b/src/tests/fixtures/field_values/MaybePromise.ts.expected.md index b4d0ab77..be404024 100644 --- a/src/tests/fixtures/field_values/MaybePromise.ts.expected.md +++ b/src/tests/fixtures/field_values/MaybePromise.ts.expected.md @@ -10,12 +10,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { b: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/OptionalFields.ts.expected.md b/src/tests/fixtures/field_values/OptionalFields.ts.expected.md index 81fd7915..2996f932 100644 --- a/src/tests/fixtures/field_values/OptionalFields.ts.expected.md +++ b/src/tests/fixtures/field_values/OptionalFields.ts.expected.md @@ -24,15 +24,20 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { adieu: String farewell: String goodbye: String hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md b/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md index b2bcd536..3a1cd09b 100644 --- a/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md +++ b/src/tests/fixtures/field_values/OptionalProperty.ts.expected.md @@ -10,12 +10,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md b/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md index 4e6598fc..a705c3df 100644 --- a/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md +++ b/src/tests/fixtures/field_values/ParenthesizedType.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: [String] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md b/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md index e3bfea65..6d1b5224 100644 --- a/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md +++ b/src/tests/fixtures/field_values/PromiseOfPromise.ts.expected.md @@ -10,12 +10,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { b: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md b/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md index 8216adaf..58095483 100644 --- a/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md +++ b/src/tests/fixtures/field_values/ReadonlyArrayField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: [String!] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/RenamedType.ts.expected.md b/src/tests/fixtures/field_values/RenamedType.ts.expected.md index 63233287..b528acfe 100644 --- a/src/tests/fixtures/field_values/RenamedType.ts.expected.md +++ b/src/tests/fixtures/field_values/RenamedType.ts.expected.md @@ -16,8 +16,9 @@ class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { me: User } @@ -25,7 +26,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md b/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md index dabb397a..56ac7b17 100644 --- a/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md +++ b/src/tests/fixtures/field_values/RenamedTypeOutOfOrder.ts.expected.md @@ -16,8 +16,9 @@ class UserResolver { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { me: User } @@ -25,7 +26,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/StringField.ts.expected.md b/src/tests/fixtures/field_values/StringField.ts.expected.md index a136faab..a03f5c2e 100644 --- a/src/tests/fixtures/field_values/StringField.ts.expected.md +++ b/src/tests/fixtures/field_values/StringField.ts.expected.md @@ -12,12 +12,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md b/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md index 9fce4a92..74c556f9 100644 --- a/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md +++ b/src/tests/fixtures/field_values/StringFieldKillsParentOnException.ts.expected.md @@ -15,12 +15,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String! } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/UnionField.ts.expected.md b/src/tests/fixtures/field_values/UnionField.ts.expected.md index c32f2d09..6c4004ef 100644 --- a/src/tests/fixtures/field_values/UnionField.ts.expected.md +++ b/src/tests/fixtures/field_values/UnionField.ts.expected.md @@ -29,8 +29,9 @@ type Actor = User | Entity; ## Output -``` --- SDL -- +### SDL + +```graphql union Actor = Entity | User type Entity { @@ -44,7 +45,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EntityType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md b/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md index 5c032e7b..4ebe2799 100644 --- a/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md +++ b/src/tests/fixtures/field_values/non_default_nullable/NonNullablePromise.ts.expected.md @@ -13,12 +13,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String! } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md b/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md index 274ca888..ea33b94a 100644 --- a/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md +++ b/src/tests/fixtures/field_values/non_default_nullable/NullablePromise.ts.expected.md @@ -13,12 +13,17 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md b/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md index ec4aa8cb..6074b448 100644 --- a/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md +++ b/src/tests/fixtures/generics/complexMutualReferences.ts.expected.md @@ -24,8 +24,9 @@ type Baz = { ## Output -``` --- SDL -- +### SDL + +```graphql type Baz { bazField: BazBar } @@ -38,7 +39,11 @@ type BazFoo { baz: Baz someField: BazBar } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const BazFooType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/connection.ts.expected.md b/src/tests/fixtures/generics/connection.ts.expected.md index 4e3bea96..59e05202 100644 --- a/src/tests/fixtures/generics/connection.ts.expected.md +++ b/src/tests/fixtures/generics/connection.ts.expected.md @@ -44,8 +44,9 @@ type PageInfo = { ## Output -``` --- SDL -- +### SDL + +```graphql type Page { name: String } @@ -70,7 +71,11 @@ type PageInfo { type User { pages: PageConnection } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLBoolean } from "graphql"; export function getSchema(): GraphQLSchema { const PageType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md b/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md index 0703ca5d..8d329903 100644 --- a/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/connectionEdgeAsGeneric.ts.expected.md @@ -44,8 +44,9 @@ type PageInfo = { ## Output -``` --- SDL -- +### SDL + +```graphql type Page { name: String } @@ -70,7 +71,11 @@ type PageInfo { type User { pages: PageEdgeConnection } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLBoolean } from "graphql"; export function getSchema(): GraphQLSchema { const PageType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md b/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md index 4d8d0b68..8c9ebc5e 100644 --- a/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/defineFieldOnGeneric.ts.expected.md @@ -25,8 +25,9 @@ export function title(edge: Edge): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Page { title: String } @@ -37,7 +38,11 @@ type PageEdge { """Re-expose title directly on the edge""" title: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { title as pageEdgeTitleResolver } from "./defineFieldOnGeneric"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/edge.ts.expected.md b/src/tests/fixtures/generics/edge.ts.expected.md index 4c363ced..d64ad176 100644 --- a/src/tests/fixtures/generics/edge.ts.expected.md +++ b/src/tests/fixtures/generics/edge.ts.expected.md @@ -38,8 +38,9 @@ type PageInfo = { ## Output -``` --- SDL -- +### SDL + +```graphql type Page { name: String } @@ -60,7 +61,11 @@ type PageInfo { hasPreviousPage: Boolean startCursor: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLList, GraphQLNonNull, GraphQLBoolean } from "graphql"; export function getSchema(): GraphQLSchema { const PageType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/genericInputType.ts.expected.md b/src/tests/fixtures/generics/genericInputType.ts.expected.md index 243e717c..0d8ed2d3 100644 --- a/src/tests/fixtures/generics/genericInputType.ts.expected.md +++ b/src/tests/fixtures/generics/genericInputType.ts.expected.md @@ -22,8 +22,9 @@ class SomeClass { ## Output -``` --- SDL -- +### SDL + +```graphql input AnotherInput { anotherField: String! } @@ -35,7 +36,11 @@ input AnotherInputSomeInput { type SomeClass { someField(someArg: AnotherInputSomeInput!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const AnotherInputType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/generics/genericInterface.ts.expected.md b/src/tests/fixtures/generics/genericInterface.ts.expected.md index 8d5c13cf..a8756bcd 100644 --- a/src/tests/fixtures/generics/genericInterface.ts.expected.md +++ b/src/tests/fixtures/generics/genericInterface.ts.expected.md @@ -27,8 +27,9 @@ class Dog { ## Output -``` --- SDL -- +### SDL + +```graphql interface DogFriendly { to: Dog } @@ -42,7 +43,11 @@ type User implements DogFriendly { name: String to: Dog } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const DogType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/genericOverArg.ts.expected.md b/src/tests/fixtures/generics/genericOverArg.ts.expected.md index 25a11ba1..caacd5f8 100644 --- a/src/tests/fixtures/generics/genericOverArg.ts.expected.md +++ b/src/tests/fixtures/generics/genericOverArg.ts.expected.md @@ -25,8 +25,9 @@ export function someField(_: Query): SomeClass { ## Output -``` --- SDL -- +### SDL + +```graphql input SomeInput { someField: String! } @@ -38,7 +39,11 @@ type Query { type SomeInputSomeClass { someField(someArg: SomeInput): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLInputObjectType, GraphQLNonNull } from "graphql"; import { someField as querySomeFieldResolver } from "./genericOverArg"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md b/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md index 56e9e44f..1d8ac9e0 100644 --- a/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md +++ b/src/tests/fixtures/generics/genericReferencedMoreThanOnce.ts.expected.md @@ -29,8 +29,9 @@ export type SomeType = { ## Output -``` --- SDL -- +### SDL + +```graphql union PageResult = Err | Page type Err { @@ -45,7 +46,11 @@ type SomeType { alsoPageResult: PageResult pageResult: PageResult } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const ErrType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md index c2554938..805fde4e 100644 --- a/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsingClass.ts.expected.md @@ -26,8 +26,9 @@ export function createEdge(_: Query): Edge { ## Output -``` --- SDL -- +### SDL + +```graphql type Page { name: String } @@ -40,7 +41,11 @@ type PageEdge { type Query { createEdge: PageEdge } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { createEdge as queryCreateEdgeResolver } from "./genericTypeUsingClass"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md b/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md index 22590119..d2e66308 100644 --- a/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md +++ b/src/tests/fixtures/generics/genericTypeUsingInterface.ts.expected.md @@ -26,8 +26,9 @@ export function createEdge(_: Query): Edge { ## Output -``` --- SDL -- +### SDL + +```graphql type Page { name: String } @@ -40,7 +41,11 @@ type PageEdge { type Query { createEdge: PageEdge } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { createEdge as queryCreateEdgeResolver } from "./genericTypeUsingInterface"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md b/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md index 4e6b6ccd..7c83b23a 100644 --- a/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/multiparamGeneric.ts.expected.md @@ -29,8 +29,9 @@ export function pageResult(_: Query): Result { ## Output -``` --- SDL -- +### SDL + +```graphql union PageErrResult = Err | Page type Err { @@ -44,7 +45,11 @@ type Page { type Query { pageResult: PageErrResult } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLUnionType, GraphQLString } from "graphql"; import { pageResult as queryPageResultResolver } from "./multiparamGeneric"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md b/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md index a0eb778c..9cf0fe40 100644 --- a/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md +++ b/src/tests/fixtures/generics/names/skippedTypeParam.ts.expected.md @@ -31,8 +31,9 @@ export function connection(): Edge { ## Output -``` --- SDL -- +### SDL + +```graphql type A { a: String } @@ -48,7 +49,11 @@ type BEdge { type Query { connection: BEdge } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { connection as queryConnectionResolver } from "./skippedTypeParam"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md b/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md index 0c7110a5..590c72db 100644 --- a/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md +++ b/src/tests/fixtures/generics/names/skippedTypeParamPassesLiteral.ts.expected.md @@ -36,8 +36,9 @@ export function connection(): Edge< ## Output -``` --- SDL -- +### SDL + +```graphql type A { a: String } @@ -53,7 +54,11 @@ type BEdge { type Query { connection: BEdge } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { connection as queryConnectionResolver } from "./skippedTypeParamPassesLiteral"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/generics/result.ts.expected.md b/src/tests/fixtures/generics/result.ts.expected.md index ecb4d898..7380f57b 100644 --- a/src/tests/fixtures/generics/result.ts.expected.md +++ b/src/tests/fixtures/generics/result.ts.expected.md @@ -27,8 +27,9 @@ export type SomeType = { ## Output -``` --- SDL -- +### SDL + +```graphql union PageResult = Err | Page type Err { @@ -42,7 +43,11 @@ type Page { type SomeType { pageResult: PageResult } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const ErrType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md b/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md index e7dde38f..f4d32853 100644 --- a/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md +++ b/src/tests/fixtures/generics/scalarPassedAsNonGqlGenericArg.ts.expected.md @@ -16,8 +16,9 @@ type OtherType = { ## Output -``` --- SDL -- +### SDL + +```graphql type OtherType { wrapper: Wrapper } @@ -25,7 +26,11 @@ type OtherType { type Wrapper { value: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const WrapperType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md b/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md index 78e32afc..6a97fb01 100644 --- a/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md +++ b/src/tests/fixtures/generics/scalarWithGeneric.ts.expected.md @@ -8,10 +8,15 @@ export type MyScalar = T; ## Output -``` --- SDL -- +### SDL + +```graphql scalar MyScalar --- TypeScript -- +``` + +### TypeScript + +```ts import type { GqlScalar } from "grats"; import type { MyScalar as MyScalarInternal } from "./scalarWithGeneric"; import { GraphQLSchema, GraphQLScalarType } from "graphql"; diff --git a/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md b/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md index 3ea98d77..9683902a 100644 --- a/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md +++ b/src/tests/fixtures/generics/todo/genericTypeMemberOfUnion.ts.expected.md @@ -23,12 +23,17 @@ class Dog { ## Output -``` --- SDL -- +### SDL + +```graphql type Dog { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const DogType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/headers/customHeaders.ts.expected.md b/src/tests/fixtures/headers/customHeaders.ts.expected.md index 35690e79..cdb3e6e0 100644 --- a/src/tests/fixtures/headers/customHeaders.ts.expected.md +++ b/src/tests/fixtures/headers/customHeaders.ts.expected.md @@ -11,14 +11,19 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql # Generated SDL type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts // Generated TS import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; diff --git a/src/tests/fixtures/headers/multilineHeader.ts.expected.md b/src/tests/fixtures/headers/multilineHeader.ts.expected.md index d6ea0d25..d3d58d8a 100644 --- a/src/tests/fixtures/headers/multilineHeader.ts.expected.md +++ b/src/tests/fixtures/headers/multilineHeader.ts.expected.md @@ -11,8 +11,9 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql # Generated SDL # multi-line @@ -20,7 +21,11 @@ export default class SomeType { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts // Generated TS // multi-line diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md index 722e821f..b3a90aa0 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldIsNullable.ts.expected.md @@ -9,13 +9,18 @@ export type Greeting = { firstName: string } | { lastName: string | null }; ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { firstName: String lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md index 383d2d83..1fd8a2ea 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldIsOptional.ts.expected.md @@ -9,13 +9,18 @@ export type Greeting = { firstName: string } | { lastName?: string }; ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { firstName: String lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md index 622bc832..ac025b6f 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeList.ts.expected.md @@ -9,13 +9,18 @@ export type Greeting = { firstName: string } | { lastName: Array }; ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { firstName: String lastName: [String!] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString, GraphQLList, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md index 5757e93c..534ef451 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfFieldTypeListOfNullable.ts.expected.md @@ -11,13 +11,18 @@ export type Greeting = ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { firstName: String lastName: [String] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString, GraphQLList } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md index 8e74332f..a24495d1 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescription.ts.expected.md @@ -15,13 +15,18 @@ export type Greeting = ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { firstName: String lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md index 19a692e7..5ae2a68f 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfWithFieldDescriptionInsideObj.ts.expected.md @@ -19,15 +19,20 @@ export type Greeting = ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { """First Name""" firstName: String """Last Name""" lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md b/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md index dd6af796..afd5a240 100644 --- a/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/oneOfWithTypeDescription.ts.expected.md @@ -11,14 +11,19 @@ export type Greeting = { firstName: string } | { lastName: string }; ## Output -``` --- SDL -- +### SDL + +```graphql """A popular way to greet someone.""" input Greeting @oneOf { firstName: String lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md b/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md index 4551d670..53f67b71 100644 --- a/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/simpleOneOf.ts.expected.md @@ -9,13 +9,18 @@ export type Greeting = { firstName: string } | { lastName: string }; ## Output -``` --- SDL -- +### SDL + +```graphql input Greeting @oneOf { firstName: String lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const GreetingType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputType.ts.expected.md b/src/tests/fixtures/input_types/InputType.ts.expected.md index 813b5100..0ce70f57 100644 --- a/src/tests/fixtures/input_types/InputType.ts.expected.md +++ b/src/tests/fixtures/input_types/InputType.ts.expected.md @@ -15,8 +15,9 @@ type MyInputType = { ## Output -``` --- SDL -- +### SDL + +```graphql input MyInputType { someField: String! } @@ -24,7 +25,11 @@ input MyInputType { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md index 08a1981a..da911ec6 100644 --- a/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterface.ts.expected.md @@ -17,8 +17,9 @@ class User { ## Output -``` --- SDL -- +### SDL + +```graphql input MyInputType { someField: String! } @@ -26,7 +27,11 @@ input MyInputType { type User { myField(input: MyInputType!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md b/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md index 6e761054..c54c1e0f 100644 --- a/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeInterfaceOptionalField.ts.expected.md @@ -9,12 +9,17 @@ interface MyInputType { ## Output -``` --- SDL -- +### SDL + +```graphql input MyInputType { someField: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md b/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md index c42aa503..96a0a98e 100644 --- a/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeOptionalField.ts.expected.md @@ -15,8 +15,9 @@ type MyInputType = { ## Output -``` --- SDL -- +### SDL + +```graphql input MyInputType { someField: String } @@ -24,7 +25,11 @@ input MyInputType { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md index 9a780984..0d4fceb9 100644 --- a/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithDeprecatedField.ts.expected.md @@ -18,8 +18,9 @@ type MyInputType = { ## Output -``` --- SDL -- +### SDL + +```graphql input MyInputType { """Sweet field!""" someField: String @deprecated(reason: "Sweet, but stale") @@ -28,7 +29,11 @@ input MyInputType { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md index ab157a27..077ea7bf 100644 --- a/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithDescription.ts.expected.md @@ -18,8 +18,9 @@ type MyInputType = { ## Output -``` --- SDL -- +### SDL + +```graphql """Check out this great input!""" input MyInputType { someField: String! @@ -28,7 +29,11 @@ input MyInputType { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md b/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md index 4a5a5046..dbdfa685 100644 --- a/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md +++ b/src/tests/fixtures/input_types/InputTypeWithFieldDescription.ts.expected.md @@ -16,8 +16,9 @@ type MyInputType = { ## Output -``` --- SDL -- +### SDL + +```graphql input MyInputType { """Sweet field!""" someField: String! @@ -26,7 +27,11 @@ input MyInputType { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyInputTypeType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md b/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md index fb376309..36e49d53 100644 --- a/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md +++ b/src/tests/fixtures/input_types/RenamedInputType.ts.expected.md @@ -15,8 +15,9 @@ type MyInputType = { ## Output -``` --- SDL -- +### SDL + +```graphql input OtherName { someField: String! } @@ -24,7 +25,11 @@ input OtherName { type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInputObjectType, GraphQLNonNull, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const OtherNameType: GraphQLInputObjectType = new GraphQLInputObjectType({ diff --git a/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md b/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md index 29c2a5dd..bb761d34 100644 --- a/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/FieldReturnsInterface.ts.expected.md @@ -25,8 +25,9 @@ class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { name: String } @@ -38,7 +39,11 @@ type SomeType { type User implements Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md b/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md index b709079c..5394683a 100644 --- a/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md +++ b/src/tests/fixtures/interfaces/IgnoresExtendsClause.ts.expected.md @@ -29,8 +29,9 @@ class User extends Person implements Actor { ## Output -``` --- SDL -- +### SDL + +```graphql interface Actor { name: String } @@ -42,7 +43,11 @@ type SomeType { type User implements Actor { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const ActorType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md index 83ac6e4a..5a48a719 100644 --- a/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsInterface.ts.expected.md @@ -25,8 +25,9 @@ class User implements Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { name: String } @@ -38,7 +39,11 @@ type SomeType { type User implements Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md index 4f1b80e1..8646e357 100644 --- a/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsInterfaceWithTypeParam.ts.expected.md @@ -29,8 +29,9 @@ class User implements Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { name: String } @@ -42,7 +43,11 @@ type SomeType { type User implements Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md index e6d28253..6db7a2f6 100644 --- a/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsMultipleInterfaces.ts.expected.md @@ -31,8 +31,9 @@ class User implements Person, Actor { ## Output -``` --- SDL -- +### SDL + +```graphql interface Actor { name: String } @@ -48,7 +49,11 @@ type SomeType { type User implements Actor & Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const ActorType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md b/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md index 444ea6a8..7846739c 100644 --- a/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/ImplementsRenamedInterface.ts.expected.md @@ -17,8 +17,9 @@ class User implements DONT_USE_THIS { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { name: String } @@ -26,7 +27,11 @@ interface Person { type User implements Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md index 303d4cde..b047c3ef 100644 --- a/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceDefinitionExtendsGqlInterface.ts.expected.md @@ -32,8 +32,9 @@ export interface User extends Mammal, Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Mammal { legs: Int } @@ -47,7 +48,11 @@ interface User implements Mammal & Person { legs: Int name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLInt, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const MammalType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md index f4a884e5..1cecc6eb 100644 --- a/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceExtendsInterface.ts.expected.md @@ -24,8 +24,9 @@ interface Actor extends GqlNode, Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Actor implements Node & Person { id: String name: String @@ -38,7 +39,11 @@ interface Node { interface Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const NodeType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md index 6d713a6c..4c299655 100644 --- a/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceFieldWithDescription.ts.expected.md @@ -28,8 +28,9 @@ class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson { """The person's name""" name: String @@ -42,7 +43,11 @@ type SomeType { type User implements IPerson { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const IPersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md index 0788d5bf..3fda2068 100644 --- a/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceFieldWithDescriptionThatDiffersFromType.ts.expected.md @@ -31,8 +31,9 @@ class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson { """The person's name""" name: String @@ -46,7 +47,11 @@ type User implements IPerson { """The user's name""" name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const IPersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md index ca31c9de..de1a1768 100644 --- a/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceImplementsInterface.ts.expected.md @@ -24,8 +24,9 @@ interface Actor extends GqlNode, Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Actor implements Node & Person { id: String name: String @@ -38,7 +39,11 @@ interface Node { interface Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const NodeType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md index 0d292eb5..84aaa1c6 100644 --- a/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceMergedIntoObject.ts.expected.md @@ -15,12 +15,17 @@ interface Foo { ## Output -``` --- SDL -- +### SDL + +```graphql interface Foo { id: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const FooType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md index a05a659c..9c4d9420 100644 --- a/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceWithCustomName.ts.expected.md @@ -25,8 +25,9 @@ class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { name: String } @@ -38,7 +39,11 @@ type SomeType { type User implements Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md index 9312d662..296cf461 100644 --- a/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceWithDeprecatedField.ts.expected.md @@ -27,8 +27,9 @@ class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson { name: String @deprecated(reason: "Not used anymore") } @@ -40,7 +41,11 @@ type SomeType { type User implements IPerson { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const IPersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md b/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md index 136fb5d9..a66b8584 100644 --- a/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md +++ b/src/tests/fixtures/interfaces/InterfaceWithDescription.ts.expected.md @@ -29,8 +29,9 @@ class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql """An interface describing the common elements of all people types.""" interface IPerson { name: String @@ -43,7 +44,11 @@ type SomeType { type User implements IPerson { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const IPersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md b/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md index 869bc17d..92b534d7 100644 --- a/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md +++ b/src/tests/fixtures/interfaces/extendInterfaceWithNonGqlType.ts.expected.md @@ -16,12 +16,17 @@ export interface IPerson extends IThing { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const IPersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md b/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md index 2ad90209..5b40678b 100644 --- a/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/fieldOnScalar.invalid.ts.expected.md @@ -8,6 +8,8 @@ export type Date = string; ## Output -``` +### Error Locating Type + +```text Cannot locate field `name` on type `Date`. Only object types, interfaces, and input objects have fields. ``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md b/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md index e7ef3da8..717d1864 100644 --- a/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/malformedEntitySyntax.invalid.ts.expected.md @@ -11,6 +11,8 @@ type User = { ## Output -``` +### Error Locating Type + +```text Invalid entity name: `User->name`. Expected `ParentType` or `ParentType.fieldName`. ``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md b/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md index b77b445b..048297d3 100644 --- a/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/notFoundField.invalid.ts.expected.md @@ -11,6 +11,8 @@ type User = { ## Output -``` +### Error Locating Type + +```text Cannot locate field `not_a_field` on type `User`. ``` \ No newline at end of file diff --git a/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md b/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md index 5fff679a..acad6a71 100644 --- a/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md +++ b/src/tests/fixtures/locate/notFoundType.invalid.ts.expected.md @@ -11,6 +11,8 @@ type User = { ## Output -``` +### Error Locating Type + +```text Cannot locate type `WhoopsNotARealType`. ``` \ No newline at end of file diff --git a/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md b/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md index f701f6cd..3d20eea8 100644 --- a/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md +++ b/src/tests/fixtures/regression/fieldFollowedByDeprecated.ts.expected.md @@ -15,12 +15,17 @@ class User { ## Output -``` --- SDL -- +### SDL + +```graphql type User { name: String @deprecated } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md b/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md index 2345943b..41efc453 100644 --- a/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ClassMethodWithContextValue.ts.expected.md @@ -17,12 +17,17 @@ export class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md index 4f65b1c5..740bcb6c 100644 --- a/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ClassMethodWithContextValueExported.ts.expected.md @@ -17,12 +17,17 @@ export class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md index 0c9e1db9..474ce90e 100644 --- a/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueBeforeArgs.ts.expected.md @@ -15,12 +15,17 @@ type SomeOtherType = { greeting?: string }; ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting(fallbackGreeting: String!): String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLNonNull } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md index 488212d7..89960d2b 100644 --- a/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueOptional.ts.expected.md @@ -18,12 +18,17 @@ type SomeOtherType = { greeting: string }; ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md b/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md index aef50102..876cc808 100644 --- a/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md +++ b/src/tests/fixtures/resolver_context/ContextValueReadTwice.ts.expected.md @@ -17,12 +17,17 @@ type SomeOtherType = { greeting?: string }; ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md b/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md index e8f2f4d0..f18caed5 100644 --- a/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md +++ b/src/tests/fixtures/resolver_context/FunctionWithContextValue.ts.expected.md @@ -17,12 +17,17 @@ export function greeting(_: User, ctx: GratsContext): string { ## Output -``` --- SDL -- +### SDL + +```graphql type User { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as userGreetingResolver } from "./FunctionWithContextValue"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md b/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md index 1c0499e0..01040d0b 100644 --- a/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md +++ b/src/tests/fixtures/resolver_context/MultipleClassMethodsReferencingContextValue.ts.expected.md @@ -22,13 +22,18 @@ export class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { alsoGreeting: String greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md b/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md index 4297f857..5348db0e 100644 --- a/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md +++ b/src/tests/fixtures/resolver_info/ClassMethodWithInfoValue.ts.expected.md @@ -14,12 +14,17 @@ export class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md b/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md index 049cf66b..47c90823 100644 --- a/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md +++ b/src/tests/fixtures/resolver_info/FunctionWithInfoValue.ts.expected.md @@ -14,12 +14,17 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greetz: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greetz as queryGreetzResolver } from "./FunctionWithInfoValue"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md b/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md index 39fbd668..67d7255f 100644 --- a/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md +++ b/src/tests/fixtures/resolver_info/StaticMethodWithInfoValue.ts.expected.md @@ -20,8 +20,9 @@ type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greeting: String } @@ -29,7 +30,11 @@ type Query { type SomeType { someField: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { SomeType as queryGreetingResolver } from "./StaticMethodWithInfoValue"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md index e649dd4e..8ab645eb 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNonNull.ts.expected.md @@ -17,8 +17,9 @@ export class User { ## Output -``` --- SDL -- +### SDL + +```graphql """ Indicates that a position is semantically non null: it is only null if there is a matching error in the `errors` array. In all other cases, the position is non-null. @@ -55,7 +56,11 @@ directive @semanticNonNull(levels: [Int] = [0]) on FIELD_DEFINITION type User { name: String @semanticNonNull } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLList, GraphQLInt, specifiedDirectives, GraphQLObjectType, GraphQLString, defaultFieldResolver } from "graphql"; async function assertNonNull(value: T | Promise): Promise { const awaited = await value; diff --git a/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md index c1a8a54f..d636c5c7 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNonNullMatchesInterface.ts.expected.md @@ -24,8 +24,9 @@ export class User implements IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql """ Indicates that a position is semantically non null: it is only null if there is a matching error in the `errors` array. In all other cases, the position is non-null. @@ -66,7 +67,11 @@ interface IPerson { type User implements IPerson { name: String @semanticNonNull } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLList, GraphQLInt, specifiedDirectives, GraphQLInterfaceType, GraphQLString, GraphQLObjectType, defaultFieldResolver } from "graphql"; async function assertNonNull(value: T | Promise): Promise { const awaited = await value; diff --git a/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md b/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md index 0ad4c2ca..3ebd0c88 100644 --- a/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md +++ b/src/tests/fixtures/semantic_nullability/semanticNull.ts.expected.md @@ -20,8 +20,9 @@ export class User { ## Output -``` --- SDL -- +### SDL + +```graphql """ Indicates that a position is semantically non null: it is only null if there is a matching error in the `errors` array. In all other cases, the position is non-null. @@ -58,7 +59,11 @@ directive @semanticNonNull(levels: [Int] = [0]) on FIELD_DEFINITION type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLDirective, DirectiveLocation, GraphQLList, GraphQLInt, specifiedDirectives, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md b/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md index b3038960..b2592cb3 100644 --- a/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md +++ b/src/tests/fixtures/subscriptions/InterfaceWithAsyncIterable.ts.expected.md @@ -10,12 +10,17 @@ export interface NotSubscription { ## Output -``` --- SDL -- +### SDL + +```graphql interface NotSubscription { greetings: [String!] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const NotSubscriptionType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md b/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md index 752b4cdf..31bde12f 100644 --- a/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md +++ b/src/tests/fixtures/subscriptions/NonSubscriptionClassWithAsyncIterable.ts.expected.md @@ -28,15 +28,20 @@ export class User { ## Output -``` --- SDL -- +### SDL + +```graphql type User { greetings: [String!]! greetingsMaybe: [String]! maybeGreetings: [String!] maybeGreetingsMaybe: [String] } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLNonNull, GraphQLList, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md b/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md index b92522de..a9c9f854 100644 --- a/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md +++ b/src/tests/fixtures/subscriptions/SubscriptionFunctionFieldWithAsyncIterable.ts.expected.md @@ -38,15 +38,20 @@ export async function* maybeGreetingsMaybe( ## Output -``` --- SDL -- +### SDL + +```graphql type Subscription { greetings: String! greetingsMaybe: String maybeGreetings: String maybeGreetingsMaybe: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLNonNull, GraphQLString } from "graphql"; import { greetings as subscriptionGreetingsResolver, greetingsMaybe as subscriptionGreetingsMaybeResolver, maybeGreetings as subscriptionMaybeGreetingsResolver, maybeGreetingsMaybe as subscriptionMaybeGreetingsMaybeResolver } from "./SubscriptionFunctionFieldWithAsyncIterable"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md b/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md index 460115af..190cb305 100644 --- a/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md +++ b/src/tests/fixtures/todo/EnumFromUnionTypeWithVariantWithDescription.ts.expected.md @@ -17,8 +17,9 @@ type MyEnum = ## Output -``` --- SDL -- +### SDL + +```graphql enum MyEnum { INVALID VALID @@ -27,7 +28,11 @@ enum MyEnum { type SomeType { hello: MyEnum } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLEnumType, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const MyEnumType: GraphQLEnumType = new GraphQLEnumType({ diff --git a/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md b/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md index d787ce22..a0380126 100644 --- a/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md +++ b/src/tests/fixtures/todo/RedefineBuiltinScalar.ts.expected.md @@ -7,10 +7,15 @@ export type MyUrl = string; ## Output +### SDL + +```graphql + ``` --- SDL -- --- TypeScript -- +### TypeScript + +```ts import { GraphQLSchema } from "graphql"; export function getSchema(): GraphQLSchema { return new GraphQLSchema({ diff --git a/src/tests/fixtures/todo/userExample.ts.expected.md b/src/tests/fixtures/todo/userExample.ts.expected.md index fd332679..70882891 100644 --- a/src/tests/fixtures/todo/userExample.ts.expected.md +++ b/src/tests/fixtures/todo/userExample.ts.expected.md @@ -25,8 +25,9 @@ export function fullName(user: User): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { me: User } @@ -36,7 +37,11 @@ type User { fullName: String lastName: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { fullName as userFullNameResolver, me as someTypeMeResolver } from "./userExample"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/top_level_fields/queryField.ts.expected.md b/src/tests/fixtures/top_level_fields/queryField.ts.expected.md index deac580b..ec7d2514 100644 --- a/src/tests/fixtures/top_level_fields/queryField.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryField.ts.expected.md @@ -9,12 +9,17 @@ export function greeting(): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as queryGreetingResolver } from "./queryField"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md index 4dd70ed9..3bb27e64 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldOnStaticMethod.ts.expected.md @@ -11,12 +11,17 @@ export class SomeNonGraphQLClass { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { SomeNonGraphQLClass as queryGreetingResolver } from "./queryFieldOnStaticMethod"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md index 73ee05a9..cdb30197 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldRenamed.ts.expected.md @@ -9,12 +9,17 @@ export function greetz(): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greetz as queryGreetingResolver } from "./queryFieldRenamed"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md b/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md index d25fba2b..9c8cb35a 100644 --- a/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/queryFieldWithExplicitlyDefinedQuery.ts.expected.md @@ -15,15 +15,20 @@ export type Query = unknown; ## Output -``` --- SDL -- +### SDL + +```graphql """ I might want to explicitly define a type here to provide a description. """ type Query { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as queryGreetingResolver } from "./queryFieldWithExplicitlyDefinedQuery"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md b/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md index f748b02d..d241be5a 100644 --- a/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md +++ b/src/tests/fixtures/top_level_fields/rootFields.ts.expected.md @@ -23,8 +23,9 @@ export async function* range(from: Int): AsyncIterable { ## Output -``` --- SDL -- +### SDL + +```graphql type Mutation { deleteSomething: String } @@ -36,7 +37,11 @@ type Query { type Subscription { range(from: Int!): Int } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLNonNull } from "graphql"; import { greeting as queryGreetingResolver, deleteSomething as mutationDeleteSomethingResolver, range as subscriptionRangeResolver } from "./rootFields"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md b/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md index b7d950cc..2ccc4d04 100644 --- a/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassImplementsNonGqlInterface.ts.expected.md @@ -17,13 +17,18 @@ interface IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type User { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md b/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md index def4d8b0..2c82ada6 100644 --- a/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassWithDescription.ts.expected.md @@ -14,13 +14,18 @@ export default class SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md b/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md index 22d6a0ca..79f97cbb 100644 --- a/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md +++ b/src/tests/fixtures/type_definitions/ClassWithDescriptionAndCustomName.ts.expected.md @@ -14,13 +14,18 @@ export default class NotQuery { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md b/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md index a40dc07c..40676a9f 100644 --- a/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md +++ b/src/tests/fixtures/type_definitions/RenamedType.ts.expected.md @@ -14,12 +14,17 @@ class MyClass { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md index 66ce745d..2553b7cd 100644 --- a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsInterface.ts.expected.md @@ -17,8 +17,9 @@ export default class User implements Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { hello: String } @@ -26,7 +27,11 @@ interface Person { type User implements Person { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md index 57369f16..0f5bd7ef 100644 --- a/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md +++ b/src/tests/fixtures/type_definitions/TypeFromClassDefinitionImplementsMultipleInterfaces.ts.expected.md @@ -26,8 +26,9 @@ export default class User implements Person, GqlNode { ## Output -``` --- SDL -- +### SDL + +```graphql interface Node { id: String } @@ -40,7 +41,11 @@ type User implements Node & Person { hello: String id: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const NodeType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md index 709084c1..e4c78b5f 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasOfUnknownDefinesType.ts.expected.md @@ -12,12 +12,17 @@ export function greeting(_: SomeType): string { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { greeting: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { greeting as someTypeGreetingResolver } from "./AliasOfUnknownDefinesType"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md index 8ecb0c09..9b63163d 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasType.ts.expected.md @@ -10,12 +10,17 @@ export type SomeType = { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md index 55fab30f..6165db76 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescription.ts.expected.md @@ -14,13 +14,18 @@ export type SomeType = { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md index 7068181d..d7bfdbd7 100644 --- a/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/AliasWithDescriptionAndCustomName.ts.expected.md @@ -14,13 +14,18 @@ export type NotQuery = { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md index 7cf6edb4..0676c014 100644 --- a/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/QueryAsAliasOfUnknown.ts.expected.md @@ -12,12 +12,17 @@ export function foo(_: Query): string { ## Output -``` --- SDL -- +### SDL + +```graphql type Query { foo: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; import { foo as queryFooResolver } from "./QueryAsAliasOfUnknown"; export function getSchema(): GraphQLSchema { diff --git a/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md b/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md index d54e0e23..7f1f6f09 100644 --- a/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_alias/RenamedType.ts.expected.md @@ -12,12 +12,17 @@ type MyAlias = { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md index 22b8f497..e494aeb2 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceType.ts.expected.md @@ -10,12 +10,17 @@ export default interface SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md index 3051222d..6a3fcea5 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeExtendsGqlInterface.ts.expected.md @@ -18,8 +18,9 @@ export interface User extends Person { ## Output -``` --- SDL -- +### SDL + +```graphql interface Person { name: String } @@ -27,7 +28,11 @@ interface Person { type User implements Person { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const PersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md index 5b9bc527..c93c05b0 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceTypeImplementsInterface.ts.expected.md @@ -20,8 +20,9 @@ interface HasName { ## Output -``` --- SDL -- +### SDL + +```graphql interface HasName { name: String } @@ -30,7 +31,11 @@ type User implements HasName { hello: String name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const HasNameType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md index d9203be9..d5abc7f8 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescription.ts.expected.md @@ -14,13 +14,18 @@ export default interface SomeType { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md index ed166345..aac3a6a6 100644 --- a/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/InterfaceWithDescriptionAndCustomName.ts.expected.md @@ -14,13 +14,18 @@ export default interface NotQuery { ## Output -``` --- SDL -- +### SDL + +```graphql """The root of all evil.""" type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md b/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md index 91c22d1c..e9d99c19 100644 --- a/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md +++ b/src/tests/fixtures/type_definitions_from_interface/RenamedType.ts.expected.md @@ -12,12 +12,17 @@ interface MyInterface { ## Output -``` --- SDL -- +### SDL + +```graphql type SomeType { hello: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const SomeTypeType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md index 228a1df6..4ef5b50c 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypename.ts.expected.md @@ -17,8 +17,9 @@ export interface IPerson { ## Output -``` --- SDL -- +### SDL + +```graphql interface IPerson { name: String } @@ -26,7 +27,11 @@ interface IPerson { type User implements IPerson { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLInterfaceType, GraphQLString, GraphQLObjectType } from "graphql"; export function getSchema(): GraphQLSchema { const IPersonType: GraphQLInterfaceType = new GraphQLInterfaceType({ diff --git a/src/tests/fixtures/typename/PropertyTypename.ts.expected.md b/src/tests/fixtures/typename/PropertyTypename.ts.expected.md index ea9bf142..c33e3287 100644 --- a/src/tests/fixtures/typename/PropertyTypename.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypename.ts.expected.md @@ -11,12 +11,17 @@ export class User { ## Output -``` --- SDL -- +### SDL + +```graphql type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md b/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md index 549043be..aa68d6ea 100644 --- a/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionOfOneType.ts.expected.md @@ -14,14 +14,19 @@ type Actor = User; ## Output -``` --- SDL -- +### SDL + +```graphql union Actor = User type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const UserType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/unions/DefineUnionType.ts.expected.md b/src/tests/fixtures/unions/DefineUnionType.ts.expected.md index b33ed265..25cb47b9 100644 --- a/src/tests/fixtures/unions/DefineUnionType.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionType.ts.expected.md @@ -27,8 +27,9 @@ type Actor = User | Entity; ## Output -``` --- SDL -- +### SDL + +```graphql union Actor = Entity | User type Entity { @@ -42,7 +43,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EntityType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md index 3c11371e..e41edef8 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeWithInterfaces.ts.expected.md @@ -27,8 +27,9 @@ type Actor = User | Entity; ## Output -``` --- SDL -- +### SDL + +```graphql union Actor = Entity | User type Entity { @@ -42,7 +43,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EntityType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md b/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md index cab2ed5b..a82b7ba1 100644 --- a/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md +++ b/src/tests/fixtures/unions/DefineUnionTypeWithTypeLiterals.ts.expected.md @@ -27,8 +27,9 @@ type Actor = User | Entity; ## Output -``` --- SDL -- +### SDL + +```graphql union Actor = Entity | User type Entity { @@ -42,7 +43,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EntityType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md b/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md index 1409b5cf..46919bb5 100644 --- a/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md +++ b/src/tests/fixtures/unions/UnionWithDescription.ts.expected.md @@ -30,8 +30,9 @@ type Actor = User | Entity; ## Output -``` --- SDL -- +### SDL + +```graphql """One type to rule them all, and in a union bind them.""" union Actor = Entity | User @@ -46,7 +47,11 @@ type SomeType { type User { name: String } --- TypeScript -- +``` + +### TypeScript + +```ts import { GraphQLSchema, GraphQLUnionType, GraphQLObjectType, GraphQLString } from "graphql"; export function getSchema(): GraphQLSchema { const EntityType: GraphQLObjectType = new GraphQLObjectType({ diff --git a/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md b/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md index b84d7654..4f2eba6f 100644 --- a/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md +++ b/src/tests/integrationFixtures/aliasedMethod/index.ts.expected.md @@ -31,7 +31,9 @@ export const query = /* GraphQL */ ` ## Output -``` +### Query Result + +```json { "data": { "someType": { diff --git a/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md b/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md index 305aa2e8..c2b64fb5 100644 --- a/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md +++ b/src/tests/integrationFixtures/complexDefaultInput/index.ts.expected.md @@ -28,7 +28,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Sup" diff --git a/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md b/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md index b805e5da..78f9425f 100644 --- a/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md +++ b/src/tests/integrationFixtures/complexPlurals/index.ts.expected.md @@ -52,7 +52,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "arrayOfPromises": [ diff --git a/src/tests/integrationFixtures/connectionExample/index.ts.expected.md b/src/tests/integrationFixtures/connectionExample/index.ts.expected.md index ffde72a2..f627bd72 100644 --- a/src/tests/integrationFixtures/connectionExample/index.ts.expected.md +++ b/src/tests/integrationFixtures/connectionExample/index.ts.expected.md @@ -158,7 +158,9 @@ export const query = gql` ## Output -``` +### Query Result + +```json { "data": { "firstTwo": { diff --git a/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md b/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md index c6a40c49..42eb571e 100644 --- a/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md +++ b/src/tests/integrationFixtures/customScalarSerialization/index.ts.expected.md @@ -61,7 +61,9 @@ export const variables = { ## Output -``` +### Query Result + +```json { "data": { "hello": "123", diff --git a/src/tests/integrationFixtures/deprecated/index.ts.expected.md b/src/tests/integrationFixtures/deprecated/index.ts.expected.md index 3d042c02..a53d4b4f 100644 --- a/src/tests/integrationFixtures/deprecated/index.ts.expected.md +++ b/src/tests/integrationFixtures/deprecated/index.ts.expected.md @@ -26,7 +26,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Hello World" diff --git a/src/tests/integrationFixtures/derivedContext/index.ts.expected.md b/src/tests/integrationFixtures/derivedContext/index.ts.expected.md index 1a072b35..faa1731b 100644 --- a/src/tests/integrationFixtures/derivedContext/index.ts.expected.md +++ b/src/tests/integrationFixtures/derivedContext/index.ts.expected.md @@ -25,7 +25,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Hello Roger" diff --git a/src/tests/integrationFixtures/enumDefault/index.ts.expected.md b/src/tests/integrationFixtures/enumDefault/index.ts.expected.md index bf7996cb..bbb818bc 100644 --- a/src/tests/integrationFixtures/enumDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/enumDefault/index.ts.expected.md @@ -20,7 +20,9 @@ export const query = /* GraphQL */ ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Greetings World" diff --git a/src/tests/integrationFixtures/enumExport/index.ts.expected.md b/src/tests/integrationFixtures/enumExport/index.ts.expected.md index 2eb1a31e..1a35798f 100644 --- a/src/tests/integrationFixtures/enumExport/index.ts.expected.md +++ b/src/tests/integrationFixtures/enumExport/index.ts.expected.md @@ -52,7 +52,9 @@ export const query = /* GraphQL */ ` ## Output -``` +### Query Result + +```json { "data": { "favoriteColor": "red", diff --git a/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md b/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md index 1395ab45..732962a1 100644 --- a/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/explicitNullPassedToArgWithDefault/index.ts.expected.md @@ -31,7 +31,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "got null" diff --git a/src/tests/integrationFixtures/functionField/index.ts.expected.md b/src/tests/integrationFixtures/functionField/index.ts.expected.md index 0d84ed34..9f44fac5 100644 --- a/src/tests/integrationFixtures/functionField/index.ts.expected.md +++ b/src/tests/integrationFixtures/functionField/index.ts.expected.md @@ -15,7 +15,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Hello World" diff --git a/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md b/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md index e4175083..26f438bb 100644 --- a/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md +++ b/src/tests/integrationFixtures/functionFieldRenamed/index.ts.expected.md @@ -15,7 +15,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Hello World" diff --git a/src/tests/integrationFixtures/getAcessor/index.ts.expected.md b/src/tests/integrationFixtures/getAcessor/index.ts.expected.md index 555c32d4..8e2d63da 100644 --- a/src/tests/integrationFixtures/getAcessor/index.ts.expected.md +++ b/src/tests/integrationFixtures/getAcessor/index.ts.expected.md @@ -24,7 +24,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "me": { diff --git a/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md b/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md index 113389a7..8d9c7bcf 100644 --- a/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md +++ b/src/tests/integrationFixtures/inputTypeOneOf/index.ts.expected.md @@ -40,7 +40,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "greet": "Hello, Alice!" diff --git a/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md b/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md index 990a5b39..0deb7555 100644 --- a/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md +++ b/src/tests/integrationFixtures/killsParentOnException/index.ts.expected.md @@ -28,7 +28,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "errors": [ { diff --git a/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md b/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md index 53d53403..d10470cc 100644 --- a/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md +++ b/src/tests/integrationFixtures/killsParentOnExceptionOnQuery/index.ts.expected.md @@ -24,7 +24,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "errors": [ { diff --git a/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md b/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md index d6efd12d..56ee35f8 100644 --- a/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md +++ b/src/tests/integrationFixtures/killsParentOnExceptionReturnsNull/index.ts.expected.md @@ -29,7 +29,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "errors": [ { diff --git a/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md b/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md index fcb05c03..c7b78d95 100644 --- a/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/nonNullArgWithDefault/index.ts.expected.md @@ -15,7 +15,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Hello, world!" diff --git a/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md b/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md index 2a54c2ce..1d9a45b7 100644 --- a/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/nonNullEnumDefault/index.ts.expected.md @@ -20,7 +20,9 @@ export const query = /* GraphQL */ ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Greetings World" diff --git a/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md b/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md index 1652ca76..1ac88521 100644 --- a/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md +++ b/src/tests/integrationFixtures/nonNullableListIncludesNull/index.ts.expected.md @@ -23,7 +23,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "errors": [ { diff --git a/src/tests/integrationFixtures/numericID/index.ts.expected.md b/src/tests/integrationFixtures/numericID/index.ts.expected.md index 0f5ca3ad..cee2f73b 100644 --- a/src/tests/integrationFixtures/numericID/index.ts.expected.md +++ b/src/tests/integrationFixtures/numericID/index.ts.expected.md @@ -31,7 +31,9 @@ export const variables = { ## Output -``` +### Query Result + +```json { "data": { "hello": "123" diff --git a/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md b/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md index a5525656..780acf5b 100644 --- a/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md +++ b/src/tests/integrationFixtures/parameterPropertyRenamed/index.ts.expected.md @@ -25,7 +25,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "me": { diff --git a/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md b/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md index d453c5f9..811c965d 100644 --- a/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md +++ b/src/tests/integrationFixtures/positionalNonNullArgWithDefault/index.ts.expected.md @@ -15,7 +15,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "hello": "Hello, world!" diff --git a/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md b/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md index 7e329652..84aea373 100644 --- a/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md +++ b/src/tests/integrationFixtures/promiseOfPromise/index.ts.expected.md @@ -26,7 +26,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "data": { "promiseOfPromise": "Hello world!", diff --git a/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md b/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md index 7ac94f76..3178feef 100644 --- a/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md +++ b/src/tests/integrationFixtures/resolveTypeViaClass/index.ts.expected.md @@ -88,7 +88,9 @@ export const query = /* GraphQL */ ` ## Output -``` +### Query Result + +```json { "data": { "user": { diff --git a/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md b/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md index 4a19fe66..7c03289d 100644 --- a/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md +++ b/src/tests/integrationFixtures/resolverErrorElidedToNull/index.ts.expected.md @@ -15,7 +15,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "errors": [ { diff --git a/src/tests/integrationFixtures/skipInclude/index.ts.expected.md b/src/tests/integrationFixtures/skipInclude/index.ts.expected.md index dd83f942..187b3ac1 100644 --- a/src/tests/integrationFixtures/skipInclude/index.ts.expected.md +++ b/src/tests/integrationFixtures/skipInclude/index.ts.expected.md @@ -20,7 +20,9 @@ export const query = /* GraphQL */ ` ## Output -``` +### Query Result + +```json { "data": { "greeting": "Hello World!" diff --git a/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md b/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md index e3701408..d631c149 100644 --- a/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md +++ b/src/tests/integrationFixtures/strictSemanticNullability/index.ts.expected.md @@ -62,7 +62,9 @@ export const query = ` ## Output -``` +### Query Result + +```json { "errors": [ { diff --git a/src/tests/test.ts b/src/tests/test.ts index 02792040..367f2a8c 100644 --- a/src/tests/test.ts +++ b/src/tests/test.ts @@ -96,7 +96,7 @@ const testDirs: TestDir[] = [ transformer: ( code: string, _fileName: string, - ): Result => { + ): Result => { const config = JSON.parse(code); let parsed: ParsedCommandLineGrats; const warnings: string[] = []; @@ -127,15 +127,15 @@ const testDirs: TestDir[] = [ } console.warn = consoleWarn; - let result = `-- Parsed Config --\n${JSON.stringify( - parsed.raw.grats, - null, - 2, - )}`; + const markdown = new Markdown(); + + markdown.addHeader(3, "Parsed Config"); + markdown.addCodeBlock(JSON.stringify(parsed.raw.grats, null, 2), "json"); if (warnings.length > 0) { - result += `\n-- Warnings --\n${warnings.join("\n")}`; + markdown.addHeader(3, "Warnings"); + markdown.addCodeBlock(warnings.join("\n"), "text"); } - return ok(result); + return ok(markdown); }, }, { @@ -229,7 +229,10 @@ const testDirs: TestDir[] = [ if (locationMatch != null) { const locResult = locate(schema, locationMatch[1].trim()); if (locResult.kind === "ERROR") { - return err(locResult.err); + const markdown = new Markdown(); + markdown.addHeader(3, "Error Locating Type"); + markdown.addCodeBlock(locResult.err, "text"); + return err(markdown); } return err( @@ -257,7 +260,13 @@ const testDirs: TestDir[] = [ print(docSansDirectives), ); - return ok(`-- SDL --\n${sdl}\n-- TypeScript --\n${executableSchema}`); + const markdown = new Markdown(); + markdown.addHeader(3, "SDL"); + markdown.addCodeBlock(sdl, "graphql"); + markdown.addHeader(3, "TypeScript"); + markdown.addCodeBlock(executableSchema, "ts"); + + return ok(markdown); } }, }, @@ -268,7 +277,7 @@ const testDirs: TestDir[] = [ transformer: async ( code: string, fileName: string, - ): Promise | false> => { + ): Promise | false> => { const firstLine = code.split("\n")[0]; let config: Partial = { nullableByDefault: true, @@ -367,7 +376,11 @@ const testDirs: TestDir[] = [ variableValues: server.variables, }); - return ok(JSON.stringify(data, null, 2)); + const markdown = new Markdown(); + markdown.addHeader(3, "Query Result"); + markdown.addCodeBlock(JSON.stringify(data, null, 2), "json"); + + return ok(markdown); }, }, ]; From e32a86a671d2ce7263f7e3c253747b6e18fb0ff3 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Wed, 10 Dec 2025 08:36:24 -0800 Subject: [PATCH 6/6] Avoid trimming indentation --- src/tests/Markdown.ts | 2 +- .../arguments/NullableArgumentErrors.invalid.ts.expected.md | 2 +- .../OptionalNonNullableArgument.invalid.ts.expected.md | 2 +- .../PositionalArgOptionalNotNullable.invalid.ts.expected.md | 2 +- ...tachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md | 2 +- .../comments/invalidTagInLinecomment.invalid.ts.expected.md | 2 +- src/tests/fixtures/comments/lineComment.invalid.ts.expected.md | 2 +- .../comments/lineCommentWrongCasing.invalid.ts.expected.md | 2 +- .../comments/nonJSDocBlockComment.invalid.ts.expected.md | 2 +- .../custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md | 2 +- .../EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md | 2 +- .../fieldAsArrowFunctionNotExported.invalid.ts.expected.md | 2 +- .../fixtures/extend_type/notExported.invalid.ts.expected.md | 2 +- .../FieldAsStaticClassMethodNotExported.invalid.ts.expected.md | 2 +- .../ParameterPropertyFieldNoModifier.invalid.ts.expected.md | 2 +- ...ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md | 2 +- .../asyncFunctionFieldNotExported.invalid.ts.expected.md | 2 +- .../simpleOneOfDeprecatedTag.invalid.ts.expected.md | 2 +- .../input_types/inputFieldWithGqlField.invalid.ts.expected.md | 2 +- ...ropertySignatureTypenameIncorrectName.invalid.ts.expected.md | 2 +- .../PropertySignatureTypenameMissingType.invalid.ts.expected.md | 2 +- ...opertySignatureTypenameNonLiteralType.invalid.ts.expected.md | 2 +- ...PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md | 2 +- ...pertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md | 2 +- ...tyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md | 2 +- ...ameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md | 2 +- .../PropertyTypenameNoInitializer.invalid.ts.expected.md | 2 +- .../PropertyTypenameNonStringInitializer.invalid.ts.expected.md | 2 +- .../unions/UnionAsMemberOfItself.invalid.ts.expected.md | 2 +- .../user_error/DuplicateOneOfTag.invalid.ts.expected.md | 2 +- .../user_error/GqlTagDoesNotExist.invalid.ts.expected.md | 2 +- .../fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/tests/Markdown.ts b/src/tests/Markdown.ts index 8fe50a29..4cc65ea2 100644 --- a/src/tests/Markdown.ts +++ b/src/tests/Markdown.ts @@ -39,7 +39,7 @@ export class Markdown { const fileNamePart = section.fileName ? ` title="${section.fileName}"` : ""; - output += `\`\`\`${section.fileType}${fileNamePart}\n${section.content.trim()}\n\`\`\`\n\n`; + output += `\`\`\`${section.fileType}${fileNamePart}\n${section.content.trimEnd()}\n\`\`\`\n\n`; break; } } diff --git a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md index ec7d31ac..150337a0 100644 --- a/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts.expected.md @@ -86,7 +86,7 @@ src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts:12:26 - error: Ex #### Applied Fixes ```text -* Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts + * Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts * Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts * Applied fix "Make argument optional" in grats/src/tests/fixtures/arguments/NullableArgumentErrors.invalid.ts ``` diff --git a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md index 0e3caf38..786e8868 100644 --- a/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts.expected.md @@ -37,7 +37,7 @@ src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts:4:33 - error #### Applied Fixes ```text -* Applied fix "Add '| null' to the type" in grats/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts + * Applied fix "Add '| null' to the type" in grats/src/tests/fixtures/arguments/OptionalNonNullableArgument.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md index 1fffa710..be0221c0 100644 --- a/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md +++ b/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts.expected.md @@ -43,7 +43,7 @@ src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts:10:17 - #### Applied Fixes ```text -* Applied fix "Add '| null' to the parameter type" in grats/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts + * Applied fix "Add '| null' to the parameter type" in grats/src/tests/fixtures/arguments/PositionalArgOptionalNotNullable.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md index 3f2a4219..a62df45d 100644 --- a/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts.expected.md @@ -35,7 +35,7 @@ src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts:2 #### Applied Fixes ```text -* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts + * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/detachedBlockCommentNotJSDocWithoutStar.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md index e07d915c..231527d7 100644 --- a/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts.expected.md @@ -39,7 +39,7 @@ src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts:1:4 - error: Unex #### Applied Fixes ```text -* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts + * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/invalidTagInLinecomment.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md index 94b45751..bf5c45a8 100644 --- a/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/lineComment.invalid.ts.expected.md @@ -54,7 +54,7 @@ src/tests/fixtures/comments/lineComment.invalid.ts:3:6 - error: Unexpected Grats #### Applied Fixes ```text -* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineComment.invalid.ts + * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineComment.invalid.ts * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineComment.invalid.ts ``` diff --git a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md index 429a15df..f6253a8b 100644 --- a/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts.expected.md @@ -62,7 +62,7 @@ src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts:3:6 - error: Unexp #### Applied Fixes ```text -* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts + * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/lineCommentWrongCasing.invalid.ts ``` diff --git a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md index f95fd4c3..e5e1e560 100644 --- a/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md +++ b/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts.expected.md @@ -34,7 +34,7 @@ src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts:3:4 - error: Unexpec #### Applied Fixes ```text -* Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts + * Applied fix "Convert to a docblock comment" in grats/src/tests/fixtures/comments/nonJSDocBlockComment.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md index 44606e60..cee29306 100644 --- a/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md +++ b/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts.expected.md @@ -38,7 +38,7 @@ src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts:3:4 - error: T #### Applied Fixes ```text -* Applied fix "Replace @specifiedBy with @gqlAnnotate" in grats/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts + * Applied fix "Replace @specifiedBy with @gqlAnnotate" in grats/src/tests/fixtures/custom_scalars/SpecifiedByOldSyntax.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md index 4b0d156b..28fdad96 100644 --- a/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md +++ b/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts.expected.md @@ -53,7 +53,7 @@ src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts:4:1 - err #### Applied Fixes ```text -* Applied fix "Add export keyword to enum with @gqlEnum" in grats/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts + * Applied fix "Add export keyword to enum with @gqlEnum" in grats/src/tests/fixtures/enums/EnumNotExportedWithEmitEnumsConfig.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md index ea12e99f..7bd9505d 100644 --- a/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts.expected.md @@ -39,7 +39,7 @@ src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts:7:7 - #### Applied Fixes ```text -* Applied fix "Add export keyword to exported arrow function with @gqlField" in grats/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts + * Applied fix "Add export keyword to exported arrow function with @gqlField" in grats/src/tests/fixtures/extend_type/fieldAsArrowFunctionNotExported.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md index 93880666..bab85f74 100644 --- a/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md +++ b/src/tests/fixtures/extend_type/notExported.invalid.ts.expected.md @@ -39,7 +39,7 @@ src/tests/fixtures/extend_type/notExported.invalid.ts:7:10 - error: Expected a ` #### Applied Fixes ```text -* Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/extend_type/notExported.invalid.ts + * Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/extend_type/notExported.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md index 8e67547c..22593d8a 100644 --- a/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts.expected.md @@ -48,7 +48,7 @@ src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid #### Applied Fixes ```text -* Applied fix "Add export keyword to class with static @gqlField" in grats/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts + * Applied fix "Add export keyword to class with static @gqlField" in grats/src/tests/fixtures/field_definitions/FieldAsStaticClassMethodNotExported.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md index 0efa51cf..41ed6ef8 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts.expected.md @@ -41,7 +41,7 @@ Learn more: https://grats.capt.dev/docs/docblock-tags/fields#class-based-fields #### Applied Fixes ```text -* Applied fix "Add 'public' modifier" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts + * Applied fix "Add 'public' modifier" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldNoModifier.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md index 61875398..ad4db917 100644 --- a/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts.expected.md @@ -42,7 +42,7 @@ Learn more: https://grats.capt.dev/docs/docblock-tags/fields#class-based-fields #### Applied Fixes ```text -* Applied fix "Make parameter property public" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts + * Applied fix "Make parameter property public" in grats/src/tests/fixtures/field_definitions/ParameterPropertyFieldReadOnlyPrivate.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md index 6939e019..9f95de8c 100644 --- a/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md +++ b/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts.expected.md @@ -37,7 +37,7 @@ src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts:2: #### Applied Fixes ```text -* Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts + * Applied fix "Add export keyword to function with @gqlField" in grats/src/tests/fixtures/field_definitions/asyncFunctionFieldNotExported.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md index 24ded58f..c98df917 100644 --- a/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md +++ b/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts.expected.md @@ -38,7 +38,7 @@ src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts:3:4 - e #### Applied Fixes ```text -* Applied fix "Remove @oneOf tag" in grats/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts + * Applied fix "Remove @oneOf tag" in grats/src/tests/fixtures/input_type_one_of/simpleOneOfDeprecatedTag.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md index 89c90ea5..ee6716dc 100644 --- a/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md +++ b/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts.expected.md @@ -35,7 +35,7 @@ src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts:3:7 - error: Th #### Applied Fixes ```text -* Applied fix "Remove @gqlField tag" in grats/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts + * Applied fix "Remove @gqlField tag" in grats/src/tests/fixtures/input_types/inputFieldWithGqlField.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md index 5f4bc728..87786961 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts.expected.md @@ -42,7 +42,7 @@ src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts:3: #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts + * Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameIncorrectName.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md index fe53f6d8..6b2a443f 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts.expected.md @@ -42,7 +42,7 @@ src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts:3:3 #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertySignatureTypenameMissingType.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md index f73f7745..7e8d3edc 100644 --- a/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts.expected.md @@ -42,7 +42,7 @@ src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts:3 #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts + * Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertySignatureTypenameNonLiteralType.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md index 6e28fbbf..a3562cd2 100644 --- a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts.expected.md @@ -36,7 +36,7 @@ src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts:3:1 #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchClassName.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md index ed58ada2..86e962df 100644 --- a/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts.expected.md @@ -36,7 +36,7 @@ src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts: #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameDoesNotMatchDeclaredName.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md index dd8c5e51..ed6acb7a 100644 --- a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts.expected.md @@ -36,7 +36,7 @@ src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid. #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsConst.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md index 714f8615..37d83376 100644 --- a/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts.expected.md @@ -38,7 +38,7 @@ src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.i #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameMustNeedToBeDeclaredAsExactlyConst.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md index ea32d245..f4fb38d9 100644 --- a/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts.expected.md @@ -36,7 +36,7 @@ src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts:3:15 - erro #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts + * Applied fix "Create Grats-compatible `__typename` type" in grats/src/tests/fixtures/typename/PropertyTypenameNoInitializer.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md index ae4dcc86..b09457a6 100644 --- a/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md +++ b/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts.expected.md @@ -36,7 +36,7 @@ src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts:3:16 #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/typename/PropertyTypenameNonStringInitializer.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md index 53452b46..6179b0c0 100644 --- a/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md +++ b/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts.expected.md @@ -70,7 +70,7 @@ src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts:16:16 - error: Expect #### Applied Fixes ```text -* Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts + * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts * Applied fix "Create Grats-compatible `__typename` property" in grats/src/tests/fixtures/unions/UnionAsMemberOfItself.invalid.ts ``` diff --git a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md index c2cfb8eb..931fc258 100644 --- a/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts.expected.md @@ -48,7 +48,7 @@ src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts:3:4 - error: Unexpect #### Applied Fixes ```text -* Applied fix "Remove duplicate @oneOf tag" in grats/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts + * Applied fix "Remove duplicate @oneOf tag" in grats/src/tests/fixtures/user_error/DuplicateOneOfTag.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md index 10c1e330..e10037f8 100644 --- a/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts.expected.md @@ -28,7 +28,7 @@ src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts:1:6 - error: `@gqlFi #### Applied Fixes ```text -* Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts + * Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/GqlTagDoesNotExist.invalid.ts ``` #### Fixed Text diff --git a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md index 30be11d3..d21a2a54 100644 --- a/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md +++ b/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts.expected.md @@ -31,7 +31,7 @@ src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts:1:6 - error: Incorrect #### Applied Fixes ```text -* Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts + * Applied fix "Change to @gqlField" in grats/src/tests/fixtures/user_error/WrongCaseGqlTag.invalid.ts ``` #### Fixed Text