profile
viewpoint

andrewgu/ModConfigMenu 9

XCOM 2 Mod Config Menu: a project to build a shared settings menu for Xcom 2 mods.

Esya/ReLaXed 0

Create PDF documents using web technologies

SCFR/Keyboard 0

Wordpress plugin to display key mapping for SC.FR

SCFR/StarMatrix 0

A matrix for starcitizen star map

Superd22/angucomplete-alt 0

Autocomplete Directive for AngularJS. A fork of Daryl Rowland's angucomplete (https://github.com/darylrowland/angucomplete) with some extra features.

Superd22/angular 0

UI-Router for Angular: State-based routing for Angular (v2+)

Superd22/angular-seed 0

Seed project for angular apps.

Superd22/apollo-server 0

🌍 GraphQL server for Express, Connect, Hapi, Koa and more

issue commentMichalLytek/type-graphql

DateTime error in subscription.

For others ending up here who work with UTC DateTime strings the package graphql-scalars can be used.

zifahm

comment created time in 4 days

issue closedMichalLytek/type-graphql

An overview of all decorators

Describe the issue It would be nice to have a list of all decorators available, similar to class-validator has: https://github.com/typestack/class-validator#validation-decorators

This offers a good quick overview of everything that is possible, and could contain links to the actual docs with more info.

Are you able to make a PR that fix this? It would be nice to first know if this is something that will be added, and where (README or docs site). But if it's not too much work I could give it a go 😄

Additional context Overall this project feels like it is lacking a formal "API Reference" docs. The documentation right now is nicely formatted and a good read when you have time, but not a great way to quickly find what you are looking for. This is maybe for another time though. For now just a list of all supported decorators would probably help both newcomers and regular users refresh their knowledge and find what they are looking for.

closed time in 4 days

reilem

issue commentMichalLytek/type-graphql

An overview of all decorators

@reilem Thanks for reporting this 😉

I will close this issue in favor of #17 where I'll track the progress. In the meantime you can explore d.ts file to know about all available decorators. There are not so many like with class-validators and they all are described in the docs text.

reilem

comment created time in 4 days

issue commentMichalLytek/type-graphql

Cannot use GraphQLSchema from another module or realm

In my case, realized I was using graphql v15.x.x in my application package.json while graphql-yoga was using graphql v14.x.x. Deleted the v15.x.x and replaced it with v14.x.x works. That created a single graphql v14.x.x to be used.

Hope this helps.

lal12

comment created time in 4 days

PR opened wemaintain/auto-relay

build(deps): bump highlight.js from 9.15.9 to 9.18.5 in /packages/type-orm

Bumps highlight.js from 9.15.9 to 9.18.5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/highlightjs/highlight.js/releases">highlight.js's releases</a>.</em></p> <blockquote> <h2>10.3.2 - Oops, "Javascript".</h2> <p>Tiny tiny release, just to fix the website incorrectly not listing Javascript in the list of languages you could choose for a custom build. NPM and CDN build should not have been affected so 10.3.1 is effectively the same as 10.3.2 for those builds.</p> <p>If you made a custom build from the website with 10.3 or 10.3.1 you may want to check and make sure it includes Javascript, and if not, build it again.</p> <h2>9.18.1 - Brrrrr, it’s freezing.</h2> <p>Quick release to resolve <a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2375">#2375</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md">highlight.js's changelog</a>.</em></p> <blockquote> <h2>Release v9.18.5</h2> <p><strong>Version 9 has reached end-of-support and will not receive future updates or fixes.</strong></p> <p>Please see <a href="https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md">VERSION_10_UPGRADE.md</a> and perhaps <a href="https://github.com/highlightjs/highlight.js/blob/master/SECURITY.md">SECURITY.md</a>.</p> <ul> <li>enh: Post-install script can be disabled with <code>HLJS_HIDE_UPGRADE_WARNING=yes</code></li> <li>fix: Deprecation notice logged at library startup a <code>console.log</code> vs <code>console.warn</code>. <ul> <li>Notice only shown if actually highlighting code, not just requiring the library.</li> <li>Node.js treats <code>warn</code> the same as <code>error</code> and that was problematic.</li> <li>You (or perhaps your indirect dependency) may disable the notice with the <code>hideUpgradeWarningAcceptNoSupportOrSecurityUpdates</code> option</li> <li>You can also set <code>HLJS_HIDE_UPGRADE_WARNING=yes</code> in your envionment to disable the warning</li> </ul> </li> </ul> <p>Example:</p> <pre lang="js"><code>hljs.configure({ hideUpgradeWarningAcceptNoSupportOrSecurityUpdates: true }) </code></pre> <p>Reference: <a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2877">highlightjs/highlight.js#2877</a></p> <h2>Release v9.18.4</h2> <p><strong>Version 9 has reached end-of-support and will not receive future updates or fixes.</strong></p> <p>Please see <a href="https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md">VERSION_10_UPGRADE.md</a> and perhaps <a href="https://github.com/highlightjs/highlight.js/blob/master/SECURITY.md">SECURITY.md</a>.</p> <ul> <li>fix(livescript) fix potential catastrophic backtracking (<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/pull/2852">#2852</a>) [<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/pull/2852/commits/ebaf171d2b3a21961b605aa6173a6a4c57346194">commit</a>]</li> </ul> <h2>Version 9.18.3</h2> <ul> <li>fix(parser) Freezing issue with illegal 0 width illegals (<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2524">#2524</a>) <ul> <li>backported from v10.x</li> </ul> </li> </ul> <h2>Version 9.18.2</h2> <p>Fixes:</p> <ul> <li>fix(night) Prevent object prototype values from being returned by <code>getLanguage</code> (<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2636">#2636</a>) <a href="https://github.com/night">night</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/highlightjs/highlight.js/commit/f54e96c24325f077a027bb950dcd9f8f3ef48b16"><code>f54e96c</code></a> 9.18.5</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/c34318b6a720a0852d27cd13dc55ca896e1292ec"><code>c34318b</code></a> fix the link since i saw it</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/d2e9bdd7597e308534fc2b0fc4aa2f935895a45d"><code>d2e9bdd</code></a> include date of last release</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/f5e06454216644cf20d7c9275d42e37707281a8e"><code>f5e0645</code></a> typos and tweaks</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/2e0e8ee996eb5b3f5c4ab25b60d910690a0e7258"><code>2e0e8ee</code></a> changelog</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/dc45f7cd21fe51a4cbb23fb36459982d1e06a6d5"><code>dc45f7c</code></a> fix(livescript) fix potential catastrophic backtracking</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/0a2624afb8dc71ef01815b49709481f06914474a"><code>0a2624a</code></a> update readme</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/d571b235c0c079ef971965a5a540eec5d68b531c"><code>d571b23</code></a> add warning</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/ec0bfd5490ca1ec667c9c2b528b364f10b9ea71d"><code>ec0bfd5</code></a> 9.18.4</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/2a04835c959f0adb18e7a3649aa68350c0286101"><code>2a04835</code></a> bump v9.18.3</li> <li>Additional commits viewable in <a href="https://github.com/highlightjs/highlight.js/compare/9.15.9...9.18.5">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+20 -4

0 comment

1 changed file

pr created time in 4 days

PR opened wemaintain/auto-relay

build(deps): bump highlight.js from 9.15.9 to 9.18.5

Bumps highlight.js from 9.15.9 to 9.18.5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/highlightjs/highlight.js/releases">highlight.js's releases</a>.</em></p> <blockquote> <h2>10.3.2 - Oops, "Javascript".</h2> <p>Tiny tiny release, just to fix the website incorrectly not listing Javascript in the list of languages you could choose for a custom build. NPM and CDN build should not have been affected so 10.3.1 is effectively the same as 10.3.2 for those builds.</p> <p>If you made a custom build from the website with 10.3 or 10.3.1 you may want to check and make sure it includes Javascript, and if not, build it again.</p> <h2>9.18.1 - Brrrrr, it’s freezing.</h2> <p>Quick release to resolve <a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2375">#2375</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md">highlight.js's changelog</a>.</em></p> <blockquote> <h2>Release v9.18.5</h2> <p><strong>Version 9 has reached end-of-support and will not receive future updates or fixes.</strong></p> <p>Please see <a href="https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md">VERSION_10_UPGRADE.md</a> and perhaps <a href="https://github.com/highlightjs/highlight.js/blob/master/SECURITY.md">SECURITY.md</a>.</p> <ul> <li>enh: Post-install script can be disabled with <code>HLJS_HIDE_UPGRADE_WARNING=yes</code></li> <li>fix: Deprecation notice logged at library startup a <code>console.log</code> vs <code>console.warn</code>. <ul> <li>Notice only shown if actually highlighting code, not just requiring the library.</li> <li>Node.js treats <code>warn</code> the same as <code>error</code> and that was problematic.</li> <li>You (or perhaps your indirect dependency) may disable the notice with the <code>hideUpgradeWarningAcceptNoSupportOrSecurityUpdates</code> option</li> <li>You can also set <code>HLJS_HIDE_UPGRADE_WARNING=yes</code> in your envionment to disable the warning</li> </ul> </li> </ul> <p>Example:</p> <pre lang="js"><code>hljs.configure({ hideUpgradeWarningAcceptNoSupportOrSecurityUpdates: true }) </code></pre> <p>Reference: <a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2877">highlightjs/highlight.js#2877</a></p> <h2>Release v9.18.4</h2> <p><strong>Version 9 has reached end-of-support and will not receive future updates or fixes.</strong></p> <p>Please see <a href="https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md">VERSION_10_UPGRADE.md</a> and perhaps <a href="https://github.com/highlightjs/highlight.js/blob/master/SECURITY.md">SECURITY.md</a>.</p> <ul> <li>fix(livescript) fix potential catastrophic backtracking (<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/pull/2852">#2852</a>) [<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/pull/2852/commits/ebaf171d2b3a21961b605aa6173a6a4c57346194">commit</a>]</li> </ul> <h2>Version 9.18.3</h2> <ul> <li>fix(parser) Freezing issue with illegal 0 width illegals (<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2524">#2524</a>) <ul> <li>backported from v10.x</li> </ul> </li> </ul> <h2>Version 9.18.2</h2> <p>Fixes:</p> <ul> <li>fix(night) Prevent object prototype values from being returned by <code>getLanguage</code> (<a href="https://github-redirect.dependabot.com/highlightjs/highlight.js/issues/2636">#2636</a>) <a href="https://github.com/night">night</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/highlightjs/highlight.js/commit/f54e96c24325f077a027bb950dcd9f8f3ef48b16"><code>f54e96c</code></a> 9.18.5</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/c34318b6a720a0852d27cd13dc55ca896e1292ec"><code>c34318b</code></a> fix the link since i saw it</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/d2e9bdd7597e308534fc2b0fc4aa2f935895a45d"><code>d2e9bdd</code></a> include date of last release</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/f5e06454216644cf20d7c9275d42e37707281a8e"><code>f5e0645</code></a> typos and tweaks</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/2e0e8ee996eb5b3f5c4ab25b60d910690a0e7258"><code>2e0e8ee</code></a> changelog</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/dc45f7cd21fe51a4cbb23fb36459982d1e06a6d5"><code>dc45f7c</code></a> fix(livescript) fix potential catastrophic backtracking</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/0a2624afb8dc71ef01815b49709481f06914474a"><code>0a2624a</code></a> update readme</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/d571b235c0c079ef971965a5a540eec5d68b531c"><code>d571b23</code></a> add warning</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/ec0bfd5490ca1ec667c9c2b528b364f10b9ea71d"><code>ec0bfd5</code></a> 9.18.4</li> <li><a href="https://github.com/highlightjs/highlight.js/commit/2a04835c959f0adb18e7a3649aa68350c0286101"><code>2a04835</code></a> bump v9.18.3</li> <li>Additional commits viewable in <a href="https://github.com/highlightjs/highlight.js/compare/9.15.9...9.18.5">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+23 -7

0 comment

2 changed files

pr created time in 4 days

issue commentMichalLytek/type-graphql

Adding any @FieldResolver crashes build

One thing to mention is that I'm able to run the code just fine with ts-node or ts-node-dev.

However, when I was trying to build the source and run it with node, I got the error.

Here's how I am building the source with tsc and babel:

tsc && babel ./src --out-dir ./build --extensions '.ts,.js'

Not sure if it's babel not respecting the emitDecoratorMetadata? here's my babel.config.js:



module.exports = function(api) {
  api.cache(true);

  const presets = [
    '@babel/env',
    '@babel/preset-typescript',
  ];
  const plugins = [
    [
      "module-resolver",
      {
        "root": [
          "."
        ],
        "alias": {
          "@common": "./src/common",
          "@services": "./src/services",
          "@entities": "./src/entities",
          "@interfaces": "./src/interfaces",
          "@repositories": "./src/repositories",
          "@db": "./src/db",
          "@graphql": "./src/graphql"
        },
        "extensions": [
          ".js",
          ".ts"
        ]
      }
    ],
    'babel-plugin-transform-typescript-metadata',
    [
      '@babel/plugin-proposal-decorators',
      {
        legacy: true
      }
    ],
    [
      '@babel/plugin-proposal-class-properties',
      {
        loose: true
      }
    ],
    '@babel/proposal-object-rest-spread',
  ];

  return {
    presets,
    plugins,
  };
}
jaminhaber

comment created time in 4 days

issue commentMichalLytek/type-graphql

Adding any @FieldResolver crashes build

I hit the same issue even with target: es2018. I have a similar set up as @jaminhaber, I logged out the def object:

{
  kind: 'external',
  methodName: 'user',
  schemaName: 'user',
  target: [Function: AdminManagerResolver],
  getType: [Function: getType],
  typeOptions: {},
  complexity: undefined,
  description: undefined,
  deprecationReason: undefined,
  resolverClassMetadata: {
    target: [Function: AdminManagerResolver],
    getObjectType: [Function (anonymous)],
    isAbstract: false
  },
  params: [
    {
      kind: 'root',
      target: [Function: AdminManagerResolver],
      methodName: 'user',
      index: 0,
      propertyName: undefined,
      getType: [Function: getType]
    }
  ],
  roles: undefined,
  middlewares: [],
  directives: [],
  extensions: {},
  getObjectType: [Function (anonymous)]
}

This is what my FieldResolver looks like:

@FieldResolver(() => User)
  public async user(@Root() manager: Manager): Promise<User> {
    return this.managerLoaders.user.load(manager.id);
  }

I made sure the tsconfig.json is correct based on the link provided above, any thoughts?

jaminhaber

comment created time in 4 days

issue openedMichalLytek/type-graphql

An overview of all decorators

Describe the issue It would be nice to have a list of all decorators available, similar to class-validator has: https://github.com/typestack/class-validator#validation-decorators

This offers a good quick overview of everything that is possible, and could contain links to the actual docs with more info.

Are you able to make a PR that fix this? It would be nice to first know if this is something that will be added, and where (README or docs site). But if it's not too much work I could give it a go 😄

Additional context Overall this project feels like it is lacking a formal "API Reference" docs. The documentation right now is nicely formatted and a good read when you have time, but not a great way to quickly find what you are looking for. This is maybe for another time though. For now just a list of all supported decorators would probably help both newcomers and regular users refresh their knowledge and find what they are looking for.

created time in 4 days

push eventMichalLytek/type-graphql

Michał Lytek

commit sha 77c93ecc197ef7e51c46a2f874d238b2eb6e643c

docs(examples): upgrade apollo cache example from apollo engine

view details

push time in 5 days

issue commentMichalLytek/type-graphql

Inconsistent behavior for defaultValue and nullable on input types

A runtime error while building the schema?

this happens. thrown by type-graphql itself at https://github.com/MichalLytek/type-graphql/blob/b45961a5929d4534a09081bb12c7b5219edd13f4/src/helpers/types.ts#L57

It doesn't make sense. What is the purpose of default value if the field is required and you can't provide null value or omit the arg/field?

required is the wrong semantic here. nullable config does not make a direct statement about whether or not a client is required to provide a value. nullable config is about what the resolver is expected to get. whether or not the client has to provide a value (semantic: required value) depends on the configuration of nullable and default value. see also the discussion linked in https://github.com/graphql/graphql-spec/issues/570

example: what is the semantic of nullable: false, defaultValue: 'foo' for a string field/arg?

  • the resolver always gets a string, since not nullable
  • the query issuer may not provide a value, since default value is available
  • if the query issuer does provide a value, it must be a string, since not nullable

example: what is the semantic of nullable: true, defaultValue: 'foo' for a string field/arg?

  • the resolver gets a string or null, since nullable
  • the query issuer may not provide a value, since default value is available
  • if the query issuer does provide a value, it must be a string or null, since nullable

example: what is the semantic of nullable: false for a string field/arg?

  • the resolver gets a string, since not nullable
  • the query issuer must provide a value and it must be a string, since not nullable and no default value is available

conclusion:

  • what the resolver is about to expect depends only on nullable
  • what the query issuer is expected to provide depends on nullable and defaultValue
backbone87

comment created time in 11 days

issue commentMichalLytek/type-graphql

graphql-subscription dependency causing memory leak

Problem is, this pull request is over a year old and it seems it won't be merged in.

So it's time for community to fork and maintain the updated version 😉

This does not solve our problem anymore with npm 7 - something to do with SemVer for packages installed directly from Git.

So go ask npm team about overriding dependencies like a yarn can do 😛

Not sure what the solution would be.

I have no idea too 🙄 Maybe in v2.0.0 I'll integrate custom subscriptions engine with compatible API for other pubsub addons (redis, etc.).

urossmolnik

comment created time in 11 days

issue commentMichalLytek/type-graphql

Inconsistent behavior for defaultValue and nullable on input types

results in a definition error.

What do you mean? A runtime error while building the schema? An explicitly named error is thrown? Every query results in error? Or the definition is not matching your expectation?

backbone87

comment created time in 11 days

issue commentMichalLytek/type-graphql

Integration with typegoose

Thank you @MichalLytek

danpaugo

comment created time in 11 days

issue closedMichalLytek/type-graphql

Using typegraphql with aws appsync

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen. You can also propose how the new API should looks like.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

closed time in 11 days

himanshu199728

issue commentMichalLytek/type-graphql

Using typegraphql with aws appsync

Closing for housekeeping purposes as I have no idea what the feature request is about 🔒

If you have questions how to achieve something, like how to use TypeGraphQL with AWS AppSync, please ask on stackoverlow or gitter chat.

himanshu199728

comment created time in 11 days

issue openedMichalLytek/type-graphql

Inconsistent behavior for defaultValue and nullable on input types

Describe the Bug A field in an input type or argument list is set to nullable: true, if a default is provided, even when the global nullable is false. Explicitly specifying nullable: false results in a definition error.

On the behavior regarding argument lists and input types with default values and nullable: https://github.com/graphql/graphql-spec/issues/570

I mentioned this in https://github.com/MichalLytek/type-graphql/issues/498#issuecomment-723673596, but created this as a separate issue since the linked issue also argues about object types (while this one is only about input types) and to increase visibility.

To Reproduce

@InputType()
class MyInput {
  // definition error, but should be `foo: Int! = 0`
  @Field(() => Int, { nullable: false; defaultValue: 0 })
  public foo!: number;

  // with global nullable: false results in `foo: Int = 0`, but should be `foo: Int! = 0`
  @Field(() => Int, { defaultValue: 0 })
  public foo!: number;
}

Expected Behavior

Lets a asume a string argument or input field:

  • nullable: true (type-graphql behaves correctly)
    • omitted: resolver gets undefined (this is a "legacy" behavior of graphql-js)
    • passed null: resolver gets null
    • passed a string: resolver gets the string
  • nullable: false (type-graphql behaves correctly) (this is the only case where a value must be passed when querying)
    • omitted: error
    • passed null: error
    • passed a string: resolver gets the string
  • nullable: true, defaultValue: null (type-graphql behaves correctly)
    • omitted: resolver gets null
    • passed null: resolver gets null
    • passed a string: resolver gets the string
  • nullable: true, defaultValue: 'foo' (type-graphql behaves correctly)
    • omitted: resolver gets string "foo"
    • passed null: resolver gets null
    • passed a string: resolver gets the string
  • nullable: false, defaultValue: null: invalid definition (type-graphql behaves correctly)
  • nullable: false, defaultValue: 'foo' (type-graphql behaves incorrectly: if nullable: false is set explicitly, then type-graphql incorrectly rejects the definition as invalid. if nullable: false is set implicitly through global setting, then type-graphql silently converts the field to a nullable: true field. both cases are incorrect behavior.)
    • omitted: resolver gets string "foo"
    • passed null: error
    • passed a string: resolver gets the string

created time in 11 days

issue commentMichalLytek/type-graphql

Default values in default value of input types

@croossin i solved it by reusing the default value of the "parent" input object:

const DEFAULT_FOO = { bar: 0 };

@InputObject()
class FooInput {
  @Field({ defaultValue: DEFAULT_FOO.bar })
  public bar!: number;
}

@InputObject()
class MyInput {
  @Field({ defaultValue: DEFAULT_FOO })
  public foo!: FooInput;
}
backbone87

comment created time in 11 days

issue commentMichalLytek/type-graphql

Using typegraphql with aws appsync

Please fill the template, otherwise I'll close this issue.

himanshu199728

comment created time in 12 days

issue openedMichalLytek/type-graphql

Using typegraphql with aws appsync

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen. You can also propose how the new API should looks like.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

created time in 12 days

issue openedMichalLytek/type-graphql

graphql-subscription dependency causing memory issues

Describe the Bug

graphql-subscriptions dependency has a Promise memory leak that was fixed with pull request: https://github.com/apollographql/graphql-subscriptions/pull/209
Problem is, this pull request is over a year old and it seems it won't be merged in.

We were solving this issue by installing specific graphql-subscriptions version (github:urossmolnik/graphql-subscriptions#v1.3.0) and making sure package-lock file is properly "deduped" (npm dedupe) so version v1.1.0 of graphql-subscriptions package is not installed locally for type-graphql package.

This does not solve our problem anymore with npm 7 - something to do with SemVer for packages installed directly from Git.

To Reproduce

Start a subscriber to a subscription which rejects messages and start publishing messages. You'll notice memory keeps increasing. Memory profile will confirm. Do the same thing using github:urossmolnik/graphql-subscriptions#v1.3.0 and you'll notice memory is not increasing.

Expected Behavior

Not have a memory leak :)

created time in 12 days

issue closedMichalLytek/type-graphql

Error when using Typegraphql with webpack

Hi,

I got this error when using Typegraphql 1.1 with apollo server 2, graphql 15.4 and webpack 3.

" at assertSchema (/var/task/src/lambda.js:55464:11)", " at validateSchema (/var/task/src/lambda.js:83106:28)", " at assertValidSchema (/var/task/src/lambda.js:83130:16)", " at assertValidExecutionArguments (/var/task/src/lambda.js:129187:35)", " at executeImpl (/var/task/src/lambda.js:129135:3)", " at Object.execute (/var/task/src/lambda.js:129097:63)", " at Object.generateSchemaHash (/var/task/src/lambda.js:280278:32)", " at Server.generateSchemaDerivedData (/var/task/src/lambda.js:274214:41)", " at new ApolloServerBase (/var/task/src/lambda.js:274106:38)", " at new ApolloServer (/var/task/src/lambda.js:302986:1)", " at new Server (/var/task/src/lambda.js:271047:9)", " at createServer (/var/task/src/lambda.js:186602:20)",

Does this library support webpack or not?

Thanks CJ

closed time in 16 days

cjnoname

issue commentMichalLytek/type-graphql

Error when using Typegraphql with webpack

@MichalLytek

Here is a workaround: https://github.com/apollographql/apollo-server/issues/4637#issuecomment-706813287

Can close now. Thanks

cjnoname

comment created time in 16 days

issue commentMichalLytek/type-graphql

Fields decorator to inject parsed AST info

I would like to share the Field Decorator I just made: in combination with mongoose, it takes a field reference and returns the object I need with the minimum operations.

  • if I already have the object populated, it is returned as is.
  • otherwise, if I only need the 'id', I return a basic object {id: ref}
  • finally, if more fields are required, I fetch the object in the database

Maybe someone will find that useful.

import {DocumentType, isRefType, Ref} from '@typegoose/typegoose'
import {GraphQLOutputType} from 'graphql'
import {parseResolveInfo, ResolveTree, simplifyParsedResolveInfoFragmentWithType} from 'graphql-parse-resolve-info'
import {Model} from 'mongoose'
import {createParamDecorator} from 'type-graphql'

export default function ResolveRef<T>(Model: Model<DocumentType<T>>) {
  return createParamDecorator(({root, info}) => {
    const resolveTree = parseResolveInfo(info) as ResolveTree
    const ref = root[resolveTree.name] as Ref<any>
    return isRefType(ref) ? onlyRequiresId(resolveTree, info.returnType) ? {id: ref} : Model.findById(ref) : ref as T
  })
}

function onlyRequiresId(resolveTree: ResolveTree, type: GraphQLOutputType) {
  const {fields} = simplifyParsedResolveInfoFragmentWithType(resolveTree, type)
  for (let field in fields) {
    if (field !== 'id') {
      return false
    }
  }
  return true
}
MichalLytek

comment created time in 17 days

issue commentMichalLytek/type-graphql

Public / Private API

A suggestion to overcome this issue would be by using graphql-federation.

Create a public graphql service which includes all schemas/objects/resolvers which are required to be public.

And extend on the public schema for the additional fields using graphql-federation so that the types can have more fields, more resolvers can be accessible.

Afterwards you will have an endpoint for the public API and a seperate one for the federation API which combines the private and public part.

dcarniel

comment created time in 17 days

issue commentMichalLytek/type-graphql

Public / Private API

A suggestion to overcome this issue would be by using graphql-federation.

Create a public graphql service which includes all schemas/objects/resolvers which are required to be public.

And extend on the public schema for the additional fields using graphql-federation so that the types can have more fields, more resolvers can be accessible.

Afterwards you will have an endpoint for the public API and a seperate one for the federation API which combines the private and public part.

dcarniel

comment created time in 17 days

issue openedMichalLytek/type-graphql

[0.8.4] Error when generating code

Describe the Bug Yesterday I downgraded prisma from 2.11.0 to 2.10.2 to be able to use with your marvellous library. This morning I have seen your update to 0.8.4 and I have upgrade my prisma version to 2.11.0 again and update yours. And when I try to generate the code it throws this error. Object.fromEntries is not a function

To Reproduce

  prisma generate

Environment variables loaded from D:\project\prisma\.env
Prisma schema loaded from prisma\schema.prisma
Error: 
✔ Generated Prisma Client (version: 2.11.0) to .\node_modules\@prisma\client in 188ms

TypeError: Object.fromEntries is not a function
    at Object.generateEnhanceMap (D:\project\node_modules\typegraphql-prisma\lib\generator\enhance.js:20:63)
    at Object.generateCode [as default] (D:\project\node_modules\typegraphql-prisma\lib\generator\generate-code.js:158:15)
    at Object.generate [as onGenerate] (D:\project\node_modules\typegraphql-prisma\lib\cli\prisma-generator.js:32:34)

Environment (please complete the following information):

  • OS: Windows
  • Node: 10.19.0
  • Package version: 0.8.4
  • TypeScript version: 4.0.5
  • @prisma/cli & @prisma/client: 2.11.0

Thanks for all your work!

created time in 17 days

issue commentMichalLytek/type-graphql

Adding any @FieldResolver crashes build

thanks

jaminhaber

comment created time in 17 days

more