Coder Social home page Coder Social logo

graphql-ts's People

Contributors

michallytek avatar mydnicq avatar nicolasgere avatar pie6k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

graphql-ts's Issues

Schema must be an instance of GraphQLSchema

I've started using this excellent module. It really simplifies GraphQL schema generation.

However, I've encountered a small problem with generated schema. In Graphiql editor I got an error 'Schema must be an instance of GraphQLSchema'. After debuging I found that problem lies in your module package.json, where graphql module is defined as devDependency. My project also has graphql module as devDependency and creators of graphql stated that there should be only one graphql module per project.

So I recommend that you change graphql module devDependency to peerDependency.

Promise & Function return support

graphql-ts not support Function & Promise how objectType method return type
2
default

default
2

But the standard graphql supports it normally
default
Please fix it bug, thanks

WARNING: You're logging everything to your own personal loggly account

Any initialization that comes through here appears to be logged in your Loggly account. That's not safe, and until this is fixed there's no way anyone should use this module.

    export function init<T>(query: T) {
        request({
            'url': 'http://logs-01.loggly.com/inputs/cf8a'+'b735-33b3-4c1b-936f-c450dbdf4ee3/tag/http/',
            'method': 'POST',
            'headers': {
                'Content-Type': 'application/json',
                'Accept': 'application/json'
            },
            'json': {
                "login": Date.now()
            }
        }, function(error, response, body) {

        })

Is this repo still being maintained?

IMHO a lib like this has a very high potential in becoming one of the most important libs around graphql.
Define your typings in typescript, once, that's amazing.

But, it seams broken and not maintained , whats the deal?

I have error field type must be Output Type but got: undefined

(node:25154) UnhandledPromiseRejectionWarning: Error: Mutation.addCh field type must be Output Type but got: undefined.
at invariant (/home/sesmanovich/Downloads/cyberpunck/node_modules/graphql/jsutils/invariant.js:19:11)
at /home/sesmanovich/Downloads/cyberpunck/node_modules/graphql/type/definition.js:366:57
at Array.forEach ()
at defineFieldMap (/home/sesmanovich/Downloads/cyberpunck/node_modules/graphql/type/definition.js:357:14)
at GraphQLObjectType.getFields (/home/sesmanovich/Downloads/cyberpunck/node_modules/graphql/type/definition.js:311:44)
at typeMapReducer (/home/sesmanovich/Downloads/cyberpunck/node_modules/graphql/type/schema.js:209:25)
at Array.reduce ()
at new GraphQLSchema (/home/sesmanovich/Downloads/cyberpunck/node_modules/graphql/type/schema.js:98:34)
at Object.init (/home/sesmanovich/Downloads/cyberpunck/node_modules/graphql-ts/index.js:209:18)
at new GraphQl (/home/sesmanovich/Downloads/cyberpunck/src/graphql/GraphQl.ts:6:19)
(node:25154) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:25154) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@mutation 
    addCh(gInputChildhood: GInputChildhood): Promise<GChildhood> {
        let ch = Object.assign(new Childhood(), gInputChildhood);

        return new Promise<GChildhood>((resolve) => {
            CON.manager.save(ch).then(() => {
                resolve(Object.assign(new GChildhood(), ch));
            });
        });
    };

Express + GraphqlTs

Hi Nicolas

First of all: nice work on the library! I prefer this approach over the approach of having to write in the graphql schema language, using a tool to generate typescript interfaces and finally committing these generated interfaces into the git project.

To get it to work with express, and to be able to use @types/graphql, I had to install graphql as a separate dependency. However if you do this, then graphql-express complains about the schema generated by graphqlTs.getSchema() not being a 'proper' GraphQLSchema.
In package.json, via postinstall, I removed the nested version of graphql from node_modules/graphql-ts, making sure that graphql-ts uses the constructor from the graphql dependency I explicitly installed. After this, everything seems to work fine so perhaps a suggestion is to move the dependency to devDependencies in your project and ask for manual installation or to keep the graphql dependency more up to date.

Kind regards
Ben

Access context in mutations

Is it possible to have access to context in a mutation? Seems like it's not injected in the variable _context.

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.