alex-ald / postgraphile-nest Goto Github PK
View Code? Open in Web Editor NEWGraphQL (PostGraphile) module for Nest framework (node.js)
License: Other
GraphQL (PostGraphile) module for Nest framework (node.js)
License: Other
Is there any way to extend the schema with my own subscriptions using decorators?
If not - i can help by contributing
Hi,
So if i configure postgraphile using the official doc like:
**> `For Nest, this might look something like:
import { Controller, Get, Post, Req, Next, Res } from '@nestjs/common';
import { Request, Response } from 'express';
import { PostGraphileResponseNode } from 'postgraphile';
import { middleware } from './postgraphile.middleware';@controller('/')
export class PostGraphileController {
@get(middleware.graphiqlRoute)
graphiql (@Req() request: Request, @res() response: Response, @Next() next) {
middleware.graphiqlRouteHandler(new PostGraphileResponseNode(request, response, next));
}@post(middleware.graphqlRoute)
graphql (@Req() request: Request, @res() response: Response, @Next() next) {
middleware.graphqlRouteHandler(new PostGraphileResponseNode(request, response, next));
}
}`**
All my nestjs global interceptors and guards work.
But when i configure postgraphile using your module's forRoot method, none of my global interceptors/guards get executed. I'm able to execute middlewares configured for /graphql but not interceptors/guards.
Any hint would be helpful. Thank you.
Hello!
Does anyone have an autohorization implementation using Nest AuthGuards?
Hello there!
Thank you very much, I was about to write very similar stuff for Admin Panel purpose (will most likely publish ra-data-postraphile pkg as well)
as wiki mentions: playground (optional): set this to true to enable the Playground interface (Defaults to false)
- for me this does not work. However, using "native" option graphiql: true
takes correct effect - but only if provided together with playground
. This is rather strange effect, not sure if desired or has any practical reasons.
I just noticed that if playground
and graphiql
are both true
, both paths are available. I believe it should be consistent with postrgraphi and keep original route instead of playground
๐ค
Would be happy to assist in "fixing" (or documenting) this is you can drop any hint.
Thanks!
It is not possible to use NestJS with newer version (alos it works)
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! @nestjs/common@"^8.2.3" from the root project
npm ERR! peer @nestjs/common@"^7.0.0 || ^8.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/config
npm ERR! @nestjs/config@"^1.2.1" from the root project
npm ERR! 3 more (@nestjs/core, @nestjs/platform-express, @nestjs/testing)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^7.6.6" from [email protected]
npm ERR! node_modules/postgraphile-nest
npm ERR! postgraphile-nest@"^1.0.6" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! peer @nestjs/common@"^7.6.6" from [email protected]
npm ERR! node_modules/postgraphile-nest
npm ERR! postgraphile-nest@"^1.0.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\regis\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\regis\AppData\Local\npm-cache\_logs\2022-10-19T09_07_19_528Z-debug-0.log
I have to use npm i --force
all the time...
Can you create an example project which uses this module?
I am using the build.hook('build') to change the BigFloat to Float, but I can't use the same pattern as for the rest. Which is a shame, any chance it could be added?
When specifying a Query or Mutation that can accept arguments, the fieldName is used as the key for the resolver function. This results in errors when trying to execute said Mutation and Query because it can't find the associated resolver.
When changing the following code:
To this:
[fieldName.match(/^\w+/)[0]]: async (query, args, context, resolveInfo) => {
It works. The above code matches the name of the Mutation or Query. If you want a reproduction, just grab one of your examples from the wiki for extendSchema, they both have arguments and will error out.
Is it possible to integrate all the @nestjs/graphql ecosystem into postgraphile?
I want to use my @Resolver()
s with @AuthGuard()
s along with postgraphile and get one merged schema as output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.