Giter Club home page Giter Club logo

Comments (4)

angrybrad avatar angrybrad commented on September 28, 2024

Can you share your elementapi.php file?

from element-api.

markresponsive avatar markresponsive commented on September 28, 2024

Hi,

Referring to endpoints elementapi.php
list/slug:{slug}.json
list/handle:{handle}/slug:{slug}.json
I am using two classes ListTransformer and DetailTransformer
The purpose of the two different classes is that I may be able to select collection versus single instance results. Its still in its infancy though but has a good road map.
These two classes extend FieldTransformer

When I was referring to data through the ListTransformer I was receiving paginated meta keys as well and no errors.
Then using the DetailTransformer class I was using 'first' => true, and errors were resulting.
I was printing the objects that were being returned in ListTransformer and DetailTransformer prior to being converted to JSON and structurally they were exactly the same except when passing to Fractal it chokes.
There is a temporary fix on single instance results in DetailTransformer class
return array('data' => $result);

config.zip

from element-api.

angrybrad avatar angrybrad commented on September 28, 2024

Ahh, looks like that's going to be pretty difficult to try and replicate locally. If you enable devMode, do you get a full stack trace with the error? Might give some insight into where it's coming from (3rd party plugin related, etc.). Also, if you've got xDebug installed, probably worth setting some strategic breakpoints in ElementApiController and stepping through to see what's happening.

from element-api.

markresponsive avatar markresponsive commented on September 28, 2024

Ok rabbit hole incident expecting an array and was passing an object, confusion was with the collections being objects within an array.
Thanks

from element-api.

Related Issues (20)

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.