by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Konstantin Kostiuk
    @SET001
    actually I'm not sure that json is a proper thing for me here
    json is a string
    when I need object
    Stephan Meijer
    @smeijer
    yes, but graphql doesn't support an "any" type. The client can just send an object type, as it's all converted to json anyway. On the server, I'm not sure, either the json is automatically converted in an object (JSON is pretty native to Node), or you'll need a JSON.parse

    Don't shoot me if I'm wrong. But I guess the JSON is converted automatically on the server side. You don't really receive a single string; you'll receive a json object.

    I see in my code that I'm passing the json-objects directly to a json-schema-validator for custom validation. Without a JSON.parse. So in no way it's comming trough as a single string. It's a json object.

    Konstantin Kostiuk
    @SET001
    but you have to pass a JSON string in, right?
    mutation{
      newEvent(
        platform: mfd
        attributes: "{\"1\":\"2\"}"
      )
    }
    just checked - this is what should be passed and this is what I'm gettint in lamdba handler
    {
        "platform": "mfd",
        "attributes": {
            "1": "2"
        }
    }
    but I cant' pass it like object
      newEvent(
        platform: mfd
        attributes: {
          action: "asdasd"
        }
      )
    }
    this will throw an error: Validation error of type WrongType: argument 'attributes' with value 'ObjectValue{objectFields=[ObjectField{name='action', value=StringValue{value='asdasd'}}]}' is not a valid 'AWSJSON' @ 'newEvent'
    which is kinda expected
    Konstantin Kostiuk
    @SET001
    I'm trying to avoid inconvinience from necessity of stringify object before callign mutation
    Stephan Meijer
    @smeijer
    Don't need to be stringified. The Json type is black box. Only thing is, you can't "select fields" in a query.
    Jose
    @JoseThen

    Is it possible to change a query

    { 
        node {
            field { 
                title
            }
        }
    }

    to

    {
        node {
            title
        }
    }

    ?

    Brandon Buck
    @bbuck
    @JthenG9 A query is whatever you want it to be, so long as the objects are defined on the server in the way you want to query them.
    If you're asking about a server you can't change, then no.
    You query objects as they are defined.
    Alf
    @alfiehub
    Hello everyone! Im having some issues trying to set an enum value as the DefaultValue of an ArgumentConfig. Is it even possible to set the default value to the an actual enum value instead of a string?
    Josh Reeter
    @jreeter
    anyone use the neo4j-graphql library?
    also I would like to run validation on my mutations, is this usually done inside resolvers?
    Jose
    @JoseThen
    thank you @bbuck
    xialvjun
    @xialvjun
    how the server get notified when a client unsubscribe?
    Christian Budde Christensen
    @budde377
    @alfiehub There is now a PR addressing the lack of ability to render DefaultValues properly in introspection. graphql-go/graphql#398
    Gerald
    @campanagerald
    hi guys, i am using graphql apollo. is there a way to secure the fetching of schema? if anyone knows the server address they can easily fetch the schema.
    Andrea Limoli
    @limoli

    Good afternoon guys, I am new in GraphQL and I have some questions about your handler. I would like to provide at the same endpoint different queries and mutations via body in JSON format.

    {
        "query" : "{readUsers {id, username}}"
    }
    {
        "mutation" : "{createUser(username:\"Andrea\")}{id,username}"
    }

    The first query action works because handler manages the "query" value, but it seems from the code that is not the same for "mutation" field.
    How could I achieve my goal?

    swseverance
    @swseverance

    All, I'm working on a project where almost all queries / mutations require
    us to pass a 'project id' as the first parameter. For example:

    query getUsers(projectId = "123", other parameters...) { ... }
    
    or
    
    query getComments(projectId = "123", other parameters...) { ... }

    Rather than having the id as an explicit input parameter to every query / mutation,
    is there a preferred way for the frontend to pass this information to the backend?

    The approaches I've considered so far are: 1) Attach the id via HTTP headers, or
    2) Attach the id as a query parameter to every GraphQL request? Ex:
    /graphQL?projectId=123

    Stephan Meijer
    @smeijer
    i would go with 2), simply because it's easier when fiddling arround
    But I would be sure to make it as an alternative way of providing, not as the only way.
    Make sure that the native way also still works.
    swseverance
    @swseverance
    i like that idea. thanks @smeijer
    Andrea Limoli
    @limoli
    Good afternoon, could someone tell me something about the issue graphql-go/graphql#414 ?
    Andrea Limoli
    @limoli
    Moreover, I would ask you about BindFields method. Have you ever tried to execute it on a structure which has some time.Time fields? It seems that BindFields doesn't handle that.
    Andrea Limoli
    @limoli
    Song Liu
    @leopku
    Hi guys. Thanks for this awesome project first.
    I’m new to graphql-go.
    Now I had a question, how to define a custom Field in Fields.
    For example, there is an Author and a Book
    Song Liu
    @leopku
    Author := graphql.Fields{
      “id”:         &graphql.Field{Type: graphql.Int},
     “name”:  &graphql.Field{Type: graphql.String},
    }
    Post := graphql.Fields{
      “id”: &graphql.Field{Type: graphql.Int},
      “author”: &graphql.Field{Type: ???}  <— how to define here?
    }
    dinesh
    @1532j0004kg
    hello
    Bambus
    @vlatk0o

    Is there any good example for Subscription with Spring Boot application? I have tried the example in spring boot examples repo, but It is stacked at: "Your subscription data will appear here after server publication!"

    I have found this too: https://jivimberg.io/blog/2018/10/23/reactive-graphql-subscriptions-from-kafka/ but dependencies are missing and It is Kotlin and not Java...

    Christoph, René Pardon
    @renepardon

    Hi!

    I’ve two queries which don’t have parameters:

    GetInventory(): Int!

    and:

    LogoutUser(): null

    Both fail with following error:

    Syntax Error: Expected Name, found )

    If I add name: String it works but they don’t need arguments. Can you please assist me solving this error?

    I use import {buildSchema} from 'graphql‘; to build the schema for express-graphql server.

    const schema = buildSchema([typeDefs, operations].join('\r\n'));

    Where typeDefs is a concatenated string of all types and operations contains concatenated mutations and queries.

    TejaPrakashChoudary
    @tejaprakashchoudary
    Hey everyone,how to give 'Blob' in graphql
    Ex: I gave Blob in my spring boot code so now i need to integrate that spring code with graphql,so i need to give type say for example (type graphql{
    id:int!,name:string!,email:string,image:(For this what i have to give),Thanks in advance
    Tom H Anderson
    @TomHAnderson
    use a base64 encoding and make it a string
    tunguyen
    @tunguyennnnn
    hey guys, how come my delete query doesn't force my component to rerender?