Code Monkey home page Code Monkey logo

typegraphqlmodules's Introduction

GraphQL-Modules TypeGraphQL Integration Example

Introduction

This repository is an example to integrate GraphQL-Modules and TypeGraphQL projects.


Includes

Installation

To get started locally, follow these instructions:

  1. Clone to your local computer using git.
  2. Make sure that you have Node installed; see instructions here.
  3. Make sure that you have yarn installed; see instructions here.
  4. Run yarn (no arguments) from the root of your clone of this project.

Running the example

To run the example, follow these instructions:

  1. yarn start. This will use ts-node to compile and run the project.

If you want it to automatically restart the application when changes in the directory are detected, you can use yarn dev instead (it's backed by nodemon).

typegraphqlmodules's People

Contributors

ardatan avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

typegraphqlmodules's Issues

Examples for Unit Test Cases

The way we used to write unit test cases for GraphqlModules doesn't seem to work correctly after integrating GraphQLModules with TypeGraphql. If few Examples could be added as to how we should modify our test cases accordingly would be better.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency reflect-metadata to v0.2.2
  • Update dependency nodemon to v3
  • Update dependency tsconfig-paths to v4
  • Update dependency typescript to v5
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @graphql-modules/core 0.7.11
  • @graphql-modules/di 0.7.11
  • apollo-server 2.8.2
  • graphql 14.4.2
  • reflect-metadata 0.1.13
  • ts-node 8.3.0
  • tsconfig-paths 3.8.0
  • type-graphql 0.17.5
  • typescript 3.5.3
  • @types/graphql 14.2.3
  • nodemon 1.19.1

  • Check this box to trigger a request for Renovate to run again on this repository

TypeGraphQL integration with GrapQL modules doesn't seem to generate correct schema

Suppose i have a type defined like this:-

@ObjectType()
export class User {
  @Field({ nullable: true })
  images?: string;
}

and i have a resolver defined like this:-

@resolver(of => User)
export class UserResolver {
constructor() {}

@Query(returns => User)
async user(@Arg("userId") userId: string, @Arg("apiKey") apiKey:string) {
    console.log(`inside behance resolver----------------`);
    return {
        images: 'test'
    }
}

}

and finally graphqlmodule is generated like this -

export const userModule = new GraphQLModule({
providers: [UserResolver],
extraSchemas: () => [
buildSchemaSync({
resolvers: [
UserResolver
],
container: ({ context }) => context.injector
})
]
});

Everything seems to be in line with the examples that have been provided. But when i am querying it says to me:-
Cannot return null for non-nullable field Query.user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.