Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@bsField is showing up in query output #58

Closed
alxlu opened this issue Sep 30, 2018 · 4 comments · May be fixed by #76
Closed

@bsField is showing up in query output #58

alxlu opened this issue Sep 30, 2018 · 4 comments · May be fixed by #76

Comments

@alxlu
Copy link

alxlu commented Sep 30, 2018

When I create a fragment

module Fragment = [%graphql
  {|
    fragment testFragment on Testing {
        item
    }
    |}
];

and then I use it in another query

module Query = [%graphql
  {|
  query getAll {
    testing {
       ...Fragment.TestFragment @bsField(name: "testing")
    }
  }
     
|}
];

The output includes the @bsField(name: "testing"):

query getAll {
    testing {
      ...testFragment @bsField(name: "testing")
   }
}


fragment testFragment on Testing {
  item
}

This is on "graphql_ppx@0.2.7"

@alxlu
Copy link
Author

alxlu commented Sep 30, 2018

nvm... I think I may be misunderstanding what @bsField is supposed to do. Removing it completely seems to work

@alxlu alxlu closed this as completed Sep 30, 2018
@MoOx
Copy link

MoOx commented Dec 16, 2018

@mhallin I am facing this "bug" (not sure if that a pebcak issue or not) where I see @bsField in the javascript created by bs.
What can I do to have it gone (I understand this is something related to this ppx only? I am still new to graphql)?
Because Apollo doesn't seems to like this directive :)

@Emilios1995
Copy link

Emilios1995 commented Apr 12, 2019

@mhallin I'm sure this is a bug.
It also happens in 0.2.8
This is my query:

  module GQL = [%graphql
    {|
      query sharePropertyPage($id: ID!) {
        property(id: $id)  @bsDecoder(fn: "Property.decode") {
        images {
            id
            key
          }
        ...Fragments.PropertyBasicInfo @bsField(name: "basicInfo")
        }
      }
    |}
  ];

And @bsField(name: "basicInfo") is showing up in the output.
Can we reopen this?

@Emilios1995
Copy link

Isn't the solution just to add bsField in this line?

| "bsVariant" | "bsRecord" | "bsDecoder" -> true

ylecornec pushed a commit to o1-labs/graphql_ppx that referenced this issue Jun 3, 2022
* fix: drop env based configuration
* fix: drop env based configuration in favor of ppx-flags based
* Lean parse (mhallin#58)
* Simplify decoders
* Simplify
* make it even more efficient
* Add config option
* add feature flag
* make it work
* Make tests pass
* Test lean parse by default
* Remove Js.Dict.get runtime overhead
* remove comment
* fix enums
* remove comment
Co-authored-by: Jaap Frolich <jfrolich@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants