Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml deleted file mode 100644 index f498b55..0000000 --- a/.github/workflows/deploy-website.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Deploy to GitHub Pages - -on: - push: - branches: - - master - -jobs: - deploy: - name: Deploy to GitHub Pages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: yarn - - - name: Install dependencies - run: yarn install --frozen-lockfile - - name: Build website - run: yarn build - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.BOT_DEPLOYMENT_TOKEN }} - publish_dir: ./build - publish_branch: gh-pages - - # The following lines assign commit authorship to the official - # GH-Actions bot for deploys to `gh-pages` branch: - # https://github.com/actions/checkout/issues/13#issuecomment-724415212 - # The GH actions bot is used by default if you didn't specify the two fields. - # You can swap them out with your own user credentials. - # user_name: github-actions[bot] - # user_email: 41898282+github-actions[bot]@users.noreply.github.com \ No newline at end of file diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml deleted file mode 100644 index c3c0dd8..0000000 --- a/.github/workflows/pr-build.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: PR Build - -on: - pull_request: - branches: - - master - # Review gh actions docs if you want to further define triggers, paths, etc - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on - -jobs: - test-deploy: - name: Test deployment - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: yarn - - - name: Install dependencies - run: yarn install --frozen-lockfile - - name: Test build website - run: yarn build \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b2d6de3..0000000 --- a/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# Dependencies -/node_modules - -# Production -/build - -# Generated files -.docusaurus -.cache-loader - -# Misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/static/.nojekyll b/.nojekyll similarity index 100% rename from static/.nojekyll rename to .nojekyll diff --git a/404.html b/404.html new file mode 100644 index 0000000..07c8d52 --- /dev/null +++ b/404.html @@ -0,0 +1,24 @@ + + +
+ + +We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
[BatchTypeExtension(typeToExtend, fieldName)]
",id:"batchtypeextensiontypetoextend-fieldname",level:4},{value:"[BatchTypeExtension(typeToExtend, fieldName, returnType)]
",id:"batchtypeextensiontypetoextend-fieldname-returntype",level:4},{value:"[BatchTypeExtension(typeToExtend, fieldName, unionName, unionTypeA, unionTypeB, additionalUnionTypes)]
",id:"batchtypeextensiontypetoextend-fieldname-unionname-uniontypea-uniontypeb-additionaluniontypes",level:4},{value:"Deprecated",id:"deprecated",level:2},{value:"[Deprecated]
",id:"deprecated-1",level:4},{value:"[Deprecated(reasonText)]
",id:"deprecatedreasontext",level:4},{value:"Description",id:"description",level:2},{value:"[Description(text)]
",id:"descriptiontext",level:4},{value:"DirectiveLocations",id:"directivelocations",level:2},{value:"[DirectiveLocations(directiveLocation)]
",id:"directivelocationsdirectivelocation",level:4},{value:"FromGraphQL",id:"fromgraphql",level:2},{value:"[FromGraphQL(argumentName)]
",id:"fromgraphqlargumentname",level:4},{value:"[FromGraphQL(TypeExpression = "Type!")]
",id:"fromgraphqltypeexpression--type",level:4},{value:"GraphEnumValue",id:"graphenumvalue",level:2},{value:"[GraphEnumValue]
",id:"graphenumvalue-1",level:4},{value:"[GraphEnumValue(name)]
",id:"graphenumvaluename",level:4},{value:"GraphField",id:"graphfield",level:2},{value:"[GraphField]
",id:"graphfield-1",level:4},{value:"[GraphField(name)]
",id:"graphfieldname",level:4},{value:"[GraphField(TypeExpression = "Type!")]
",id:"graphfieldtypeexpression--type",level:4},{value:"GraphRoot",id:"graphroot",level:2},{value:"[GraphRoot]
",id:"graphroot-1",level:4},{value:"GraphRoute",id:"graphroute",level:2},{value:"GraphRoute(template)",id:"graphroutetemplate",level:4},{value:"GraphSkip",id:"graphskip",level:2},{value:"[GraphSkip]
",id:"graphskip-1",level:4},{value:"GraphType",id:"graphtype",level:2},{value:"[GraphType(name)]
",id:"graphtypename",level:4},{value:"[GraphType(name, inputName)]
",id:"graphtypename-inputname",level:4},{value:"Mutation, MutationRoot, Query, QueryRoot",id:"mutation-mutationroot-query-queryroot",level:2},{value:"[Query(template)]
",id:"querytemplate",level:4},{value:"[Query(returnType, params otherTypes)]
",id:"queryreturntype-params-othertypes",level:4},{value:"[Query(template, returnType)]
",id:"querytemplate-returntype",level:4},{value:"[Query(template, unionName, unionTypeA, unionTypeB, additionalUnionTypes)]
",id:"querytemplate-unionname-uniontypea-uniontypeb-additionaluniontypes",level:4},{value:"PossibleTypes",id:"possibletypes",level:2},{value:"[PossibleTypes(typeof(TypeA), typeof(TypeB) ...)]
",id:"possibletypestypeoftypea-typeoftypeb-",level:4},{value:"SpecifiedBy",id:"specifiedby",level:2},{value:"[SpecifiedBy(url)]
",id:"specifiedbyurl",level:4},{value:"TypeExtension",id:"typeextension",level:2},{value:"[TypeExtension(typeToExtend, fieldName)]
",id:"typeextensiontypetoextend-fieldname",level:4},{value:"[TypeExtension(typeToExtend, fieldName, returnType)]
",id:"typeextensiontypetoextend-fieldname-returntype",level:4},{value:"[TypeExtension(typeToExtend, fieldName, unionName, unionTypeA, unionTypeB, additionalUnionTypes)]
",id:"typeextensiontypetoextend-fieldname-unionname-uniontypea-uniontypeb-additionaluniontypes",level:4}],s={toc:d};function y(e){let{components:n,...t}=e;return(0,i.yg)("wrapper",(0,a.A)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,i.yg)("p",null,"This document contains an alphabetical reference of each of the class, property and method attributes used by GraphQL ASP.NET."),(0,i.yg)("h2",{id:"applydirective"},"ApplyDirective"),(0,i.yg)("p",null,"Declares that a given type system directive should be applied to the target schema item (an object, a field, an enum etc.). See the page on ",(0,i.yg)("a",{parentName:"p",href:"/docs/advanced/directives#type-system-directives"},"type system directives")," for complete details on how to build your own. Directives can be applied by type, by name and with or without parameters."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-csharp"},'public class Person \n{\n // apply by registered system type\n // highlight-next-line\n [ApplyDirective(typeof(DeprecatedDirective))]\n public string FirstName{ get; set; }\n\n // apply by name, also with a reason parameter\n // highlight-next-line\n [ApplyDirective("deprecated", "Last Name is deprecated")]\n public string LastName{ get; set; }\n}\n')),(0,i.yg)("h2",{id:"batchtypeextension"},"BatchTypeExtension"),(0,i.yg)("p",null,"Declares a controller action method as a field on another graph type rather than a query or mutation action. All source items needing this field resolved will be resolved in a single field request.\nThe batch method must declare a parameter of ",(0,i.yg)("inlineCode",{parentName:"p"},"IEnumerable[ApplyDirective]
attribute",id:"using-the-applydirective-attribute",level:4},{value:"Using Schema Options",id:"using-schema-options",level:4},{value:"Repeatable Directives",id:"repeatable-directives",level:3},{value:"Understanding the Type System",id:"understanding-the-type-system",level:3},{value:"Directives as Services",id:"directives-as-services",level:2},{value:"Directive Security",id:"directive-security",level:2},{value:"Security Scenarios",id:"security-scenarios",level:3},{value:"Demo Project",id:"demo-project",level:2}],p={toc:c};function d(e){let{components:t,...r}=e;return(0,a.yg)("wrapper",(0,n.A)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h2",{id:"what-is-a-directive"},"What is a Directive?"),(0,a.yg)("p",null,"Directives decorate parts of your schema or a query document to perform some sort of custom logic. What that logic is, is entirely up to you. There are several directives built into graphql:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"@include")," : An execution directive that conditionally includes a field or fragment in the results of a graphql query"),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"@skip")," : An execution directive that conditionally excludes a field or fragment from the results of a graphql query"),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"@deprecated")," : A type system directive that marks a field definition or enum value as deprecated, indicating that it may be removed in a future release of your graph."),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"@specifiedBy")," : A type system directive for a custom scalar that adds a URL pointing to documentation about how the scalar is used. This url is returned as part of an introspection query.")),(0,a.yg)("p",null,"Beyond this you can create directives to perform any sort of action against your graph or query document as seems fit to your use case."),(0,a.yg)("h2",{id:"anatomy-of-a-directive"},"Anatomy of a Directive"),(0,a.yg)("p",null,"Directives are implemented in much the same way as a ",(0,a.yg)("inlineCode",{parentName:"p"},"GraphController")," but where you'd indicate an action method as being for a query or mutation, directive action methods must indicate the location(s) they can be applied in either a query document or the type system."),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-csharp",metastring:'title="SkipDirective.cs"',title:'"SkipDirective.cs"'},'public sealed class SkipDirective : GraphDirective\n{\n [DirectiveLocations(DirectiveLocation.FIELD | DirectiveLocation.FRAGMENT_SPREAD | DirectiveLocation.INLINE_FRAGMENT)]\n public IGraphActionResult Execute([FromGraphQL("if")] bool ifArgument)\n {\n if (this.DirectiveTarget is IIncludeableDocumentPart docPart)\n docPart.IsIncluded = !ifArgument;\n\n return this.Ok();\n }\n}\n')),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-graphql",metastring:'title="Quring using @skip"',title:'"Quring',using:!0,'@skip"':!0},"# skip including flavor\nquery {\n donut(id: 15) {\n id \n name\n flavor @skip(if: true)\n }\n}\n")),(0,a.yg)("p",null,"\u2705 All directives must:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Inherit from ",(0,a.yg)("inlineCode",{parentName:"li"},"GraphQL.AspNet.Directives.GraphDirective")),(0,a.yg)("li",{parentName:"ul"},"Provide at least one action method that indicates at least 1 valid ",(0,a.yg)("inlineCode",{parentName:"li"},"DirectiveLocation"),".")),(0,a.yg)("p",null,"\u2705 All directive action methods must:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Share the same method signature"),(0,a.yg)("li",{parentName:"ul"},"The input arguments must match exactly in type, name, casing and declaration order."),(0,a.yg)("li",{parentName:"ul"},"Return a ",(0,a.yg)("inlineCode",{parentName:"li"},"IGraphActionResult")," or ",(0,a.yg)("inlineCode",{parentName:"li"},"Task