{"id":13727342,"url":"https://github.com/huv1k/nexus-arguments-validation","last_synced_at":"2025-07-25T02:32:05.296Z","repository":{"id":42934494,"uuid":"237421213","full_name":"huv1k/nexus-arguments-validation","owner":"huv1k","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T16:24:01.000Z","size":1114,"stargazers_count":10,"open_issues_count":14,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T05:18:26.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huv1k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-31T11:59:09.000Z","updated_at":"2022-01-03T14:52:25.000Z","dependencies_parsed_at":"2023-02-04T07:00:17.109Z","dependency_job_id":null,"html_url":"https://github.com/huv1k/nexus-arguments-validation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huv1k/nexus-arguments-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnexus-arguments-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnexus-arguments-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnexus-arguments-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnexus-arguments-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huv1k","download_url":"https://codeload.github.com/huv1k/nexus-arguments-validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnexus-arguments-validation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266944280,"owners_count":24010485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:03:50.915Z","updated_at":"2025-07-25T02:32:04.978Z","avatar_url":"https://github.com/huv1k.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003enexus-arguments-validation\u003c/h1\u003e\n\u003c/p\u003e\n\n`nexus-arguments-validation` is a [Nexus](https://github.com/prisma-labs/nexus) plugin for arguments validation with [Yup](https://github.com/jquense/yup).\n\n![build](https://github.com/huv1k/nexus-arguments-validation/workflows/Build%20and%20test/badge.svg)\n[![downloads](https://img.shields.io/npm/dt/nexus-arguments-validation.svg)](https://npmjs.org/package/nexus-arguments-validation?cacheSeconds=3600)\n[![version](https://img.shields.io/npm/v/nexus-arguments-validation.svg)](https://npmjs.org/package/nexus-arguments-validation?cacheSeconds=3600)\n\n## Installation\n\n```bash\nyarn add nexus-arguments-validation\n```\n\n## Example\n\n```typescript\nimport { join } from 'path'\nimport { ApolloServer } from 'apollo-server'\nimport { makeSchema, mutationField, stringArg } from 'nexus'\nimport { object, string } from 'yup'\nimport { nexusArgumentsValidationPlugin } from 'nexus-arguments-validation'\n\nconst ValidateUrl = object().shape({\n  url: string().url('Your url is not valid!'),\n})\n\nconst types = [\n  mutationField('validateUrl', {\n    type: 'String',\n    description: 'Validates the url argument as a valid URL via a regex',\n    args: {\n      url: stringArg(),\n    },\n    validationSchema: ValidateUrl,\n    resolve: (_, { url }) =\u003e {\n      return `Your url: ${url} is valid!`\n    },\n  }),\n]\n\nconst schema = makeSchema({\n  types,\n  plugins: [nexusArgumentsValidationPlugin()],\n  outputs: {\n    schema: join(__dirname, 'generated/schema.graphql'),\n    typegen: join(__dirname, 'generated/nexus.ts'),\n  },\n})\n\nnew ApolloServer({\n  schema,\n}).listen({ port: 4000 }, () =\u003e\n  console.log(`🚀 Server ready at: http://localhost:4000`),\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuv1k%2Fnexus-arguments-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuv1k%2Fnexus-arguments-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuv1k%2Fnexus-arguments-validation/lists"}