Coder Social home page Coder Social logo

loopback-graphql's Introduction

Deprecation Warning:

I have been very bad at maintaining this repo, and do not see how I come back to it in the near future. I have seen that this repo is a fork that moved forward: https://github.com/yahoohung/loopback-graphql-server/. If anyone is willing to take maintaining this repo on themselves - you are welcome. Thanks for all the feedback...

Status

Build Status

GraphQL Server for Loopback (Apollo Server)

Combine the powers of ApolloStack GraphQL with the backend of Loopback.
All of Loopback models are exposed as GraphQL Queries.
Define models in Loopback to be exposed as REST APIs and GraphQL queries and mutations *.
Use the Apollo clients to access your data.

Loopback Graphql

Getting started

npm install loopback-graphql

Add the loopback-graphql component to the server/component-config.json:

"loopback-graphql": {
    "path": "/graphql",
    "graphiqlPath":"/graphiql"
  }

Requests will be posted to path path. (Default: /graphql);

Graphiql is available on graphiqlPath path. (Default: /graphiql);

Usage

Access the Graphiql interface to view your GraphQL model on the Docs section. Build the GraphQL queries and use them in your application.

geoPoint objects are supported as follow:

{"newNote": 
  {
    "location": {"lat":40.77492964101182, "lng":-73.90950187151662}
  }
}

Roadmap

See here the Github project

loopback-graphql's People

Contributors

greenkeeper[bot] avatar mennu avatar ritish134 avatar tallyb 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  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  avatar  avatar  avatar

loopback-graphql's Issues

unable to query multiple items

Having simple model

{
  "name": "secret",
  "base": "PersistedModel",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {
    "service": {
      "type": "string",
      "required": true
    },
    "email": {
      "type": "string"
    },
    "username": {
      "type": "string"
    },
    "password": {
      "type": "string"
    }
  },
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": {}
}

I can query single item, e.g.

{
  secret (id:"5897957365e8144a83a34527") {
    id
    service
  }
}

but query for multiple items

{
  secret {
    id
    service
  }
}

ends with

{
  "errors": [
    {
      "message": "Field \"secret\" argument \"id\" of type \"ID!\" is required but not provided.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ]
    }
  ]
}

Am I doing something wrong?

An in-range update of eslint is breaking the build 🚨

Version 3.18.0 of eslint just got published.

Branch Build failing 🚨
Dependency eslint
Current Version 3.17.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v3.18.0
  • 85f74ca Fix: broken code path of direct nested loops (fixes #8248) (#8274) (Toru Nagashima)
  • a61c359 Fix: Ignore hidden folders when resolving globs (fixes #8259) (#8270) (Ian VanSchooten)
  • 6f05546 Chore: convert StubModuleResolver in config tests to ES6 class (#8265) (Teddy Katz)
  • 0c0fc31 Fix: false positive of no-extra-parens about spread and sequense (#8275) (Toru Nagashima)
  • e104973 Docs: remove self-reference in no-restricted-syntax docs (#8277) (Vitor Balocco)
  • 23eca51 Update: Add allowTaggedTemplates to no-unused-expressions (fixes #7632) (#8253) (Kevin Partington)
  • f9ede3f Upgrade: doctrine to 2.0.0 (#8269) (alberto)
  • 1b678a6 New: allow rules to listen for AST selectors (fixes #5407) (#7833) (Teddy Katz)
  • 63ca0c5 Chore: use precalculated counts in stylish formatter (#8251) (alberto)
  • 47c3171 Fix: typo in console.error (#8258) (Jan Peer Stöcklmair)
  • e74ed6d Chore: convert Traverser to ES6 class (refs #7849) (#8232) (Teddy Katz)
  • 13eead9 Fix: sort-vars crash on mixed destructuring declarations (#8245) (Teddy Katz)
  • 133f489 Fix: func-name-matching crash on destructuring assignment to functions (#8247) (Teddy Katz)
  • a34b9c4 Fix: func-name-matching crash on non-string literal computed keys (#8246) (Teddy Katz)
  • 7276e6d Docs: remove unneeded semicolons in arrow-parens.md (#8249) (Dmitry Gershun)
  • 8c40a25 Upgrade: concat-stream known to be vulnerable prior 1.5.2 (#8228) (Samuel)
  • 149c055 Upgrade: mock-fs to v4.2.0 (fixes #8194) (#8243) (Teddy Katz)
  • a83bff9 Build: remove unneeded json config in demo (fixes #8237) (#8242) (alberto)
  • df12137 Docs: fix typos (#8235) (Gyandeep Singh)
  • b5e9788 Chore: rename no-extra-parens methods (#8225) (Vitor Balocco)
  • 7f8afe6 Update: no-extra-parens overlooked spread and superClass (fixes #8175) (#8209) (Toru Nagashima)
  • ce6ff56 Docs: set recommended true for no-global-assign (fixes #8215) (#8218) (BinYi LIU)
  • 5b5c236 Fix: wrong comment when module not found in config (fixes #8192) (#8196) (alberto)
Commits

The new version differs by 26 commits .

  • ca1d478 3.18.0
  • 3688024 Build: package.json and changelog update for 3.18.0
  • 85f74ca Fix: broken code path of direct nested loops (fixes #8248) (#8274)
  • a61c359 Fix: Ignore hidden folders when resolving globs (fixes #8259) (#8270)
  • 6f05546 Chore: convert StubModuleResolver in config tests to ES6 class (#8265)
  • 0c0fc31 Fix: false positive of no-extra-parens about spread and sequense (#8275)
  • e104973 Docs: remove self-reference in no-restricted-syntax docs (#8277)
  • 23eca51 Update: Add allowTaggedTemplates to no-unused-expressions (fixes #7632) (#8253)
  • f9ede3f Upgrade: doctrine to 2.0.0 (#8269)
  • 1b678a6 New: allow rules to listen for AST selectors (fixes #5407) (#7833)
  • 63ca0c5 Chore: use precalculated counts in stylish formatter (#8251)
  • 7d1af86 Update: fix false negative of no-useless-escape in template literal tags (#8238)
  • 47c3171 Fix: typo in console.error (#8258)
  • e74ed6d Chore: convert Traverser to ES6 class (refs #7849) (#8232)
  • 13eead9 Fix: sort-vars crash on mixed destructuring declarations (#8245)

There are 26 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

mashup/aggregate

What would it take to mashup/aggregate multiple data sources (rest apis) into new models exposed by rest and graphql?

allXXX methods where parameter

I have just integrated the plugin into an existing loopback application. The auto generated allXXX methods have a where parameter of type JSON.
I can use this parameter with equals operations, for example:
allEventStates(where: {timestamp: 1487690850276}) {

But loopback filters have more operators available . Are these other operators from loopback available to the GraphQL queries when using this plugin?

Thanks

An in-range update of ts-node is breaking the build 🚨

Version 3.0.4 of ts-node just got published.

Branch Build failing 🚨
Dependency ts-node
Current Version 3.0.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ts-node is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes Default Cache Mode

Fixed

  • Always default TS_NODE_CACHE to true when unspecified
Commits

The new version differs by 2 commits0.

  • 01a6be2 3.0.4
  • d5849b4 Enable caching by default for programmatic usage (#323)

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of helmet is breaking the build 🚨

Version 3.6.0 of helmet just got published.

Branch Build failing 🚨
Dependency helmet
Current Version 3.5.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As helmet is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 4 commits0.

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of loopback-datasource-juggler is breaking the build 🚨

Version 3.6.0 of loopback-datasource-juggler just got published.

Branch Build failing 🚨
Dependency loopback-datasource-juggler
Current Version 3.5.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As loopback-datasource-juggler is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/Tallyb/loopback-graphql/builds/228141574?utm_source=github_status&utm_medium=notification)

Commits

The new version differs by 25 commits0.

  • 6bbad5e 3.6.0
  • 156b638 Merge pull request #1356 from strongloop/datetype-allow-strings
  • 5d10c72 create sequence for nosql id (#1354)
  • 6342a03 Merge pull request #1364 from strongloop/query-order
  • 6cfdcc0 Fix order of query results
  • 5e80837 Add DateString type
  • 97f243f Merge pull request #1360 from strongloop/datatype-test/use-predefined-date
  • 8e97385 datatype.test: use predefined date
  • f804663 Merge pull request #1358 from strongloop/api-doc-2
  • ef61c86 Update api documents
  • bf7ea4c Merge pull request #1333 from strongloop/api-doc-refactor
  • f7fe187 Datasource documentation tune-up
  • 238175b Added unit tests specific to DateType where null (#1349)
  • e9ff88f Fix/geo null (#1334)
  • ee254a1 Merge pull request #1339 from strongloop/invalid-dates

There are 25 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of sinon is breaking the build 🚨

Version 2.2.0 of sinon just got published.

Branch Build failing 🚨
Dependency sinon
Current Version 2.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As sinon is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/Tallyb/loopback-graphql/builds/227864579?utm_source=github_status&utm_medium=notification)

Commits

The new version differs by 40 commits0.

  • f7ff840 Update docs/changelog.md and set new release id in docs/_config.yml
  • 59a7a34 Add release documentation for v2.2.0
  • 37676e8 2.2.0
  • b35d217 Update Changelog.txt and AUTHORS for new release
  • 0127365 Merge pull request #1363 from greena13/master
  • 4fe0a73 Flatten structure of getWindowLocation()
  • 38e3ec4 Fix matchers.md in v1.17.6 and v1.17.7 releases. (#1379)
  • 3d4bc16 Merge pull request #1364 from blacksun1/add-custom-promise
  • 7ac4f60 Fixes for pull request comments
  • 25bfde0 Added docs for usingPromise
  • 0a3518f Added usingPromise method to sandbox.
  • 17edad7 Added usingPromise method to stub.
  • c5bc9ab Merge pull request #1359 from kevincennis/kce/fix-1066
  • c633202 Merge pull request #1320 from ashirley/master
  • 17c2639 Merge pull request #1366 from GProst/master

There are 40 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

Version 3.4.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v3.4.0

Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.

This week's highlights:

  • allowUncaught added to commandline as --allow-uncaught (and bugfixed)
  • warning-related Node flags

🎉 Enhancements

🐛 Fixes

🔩 Other

Commits

The new version differs by 9 commits0.

  • 7554b31 Add Changelog for v3.4.0
  • 9f7f7ed Add --trace-warnings flag
  • 92561c8 Add --no-warnings flag
  • ceee976 lint test/integration/fixtures/simple-reporter.js
  • dcfc094 Revert "use semistandard directly"
  • 93392dd no special case for macOS running Karma locally
  • 4d1d91d --allow-uncaught cli option
  • fb1e083 fix allowUncaught in browser
  • 4ed3fc5 Add license report and scan status

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of apollo-client is breaking the build 🚨

Version 1.1.2 of apollo-client just got published.

Branch Build failing 🚨
Dependency apollo-client
Current Version 1.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As apollo-client is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/Tallyb/loopback-graphql/builds/228210533?utm_source=github_status&utm_medium=notification)

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of loopback-datasource-juggler is breaking the build 🚨

Version 3.2.0 of loopback-datasource-juggler just got published.

Branch Build failing 🚨
Dependency loopback-datasource-juggler
Current Version 3.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As loopback-datasource-juggler is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 22 commits .

  • cf7f05d 3.2.0
  • 315c277 Fix should dep
  • 6d7ae88 Merge pull request #1228 from strongloop/upgrade-deps
  • 0c76bd2 Upgrade dependencies to remove npm install warnings
  • 5a72833 Merge pull request #1222 from strongloop/fix-missing-return-for-kvao-delete-all
  • 9a0d34a Add missing return for KVAO delete all
  • 22f2abf Merge pull request #1220 from strongloop/add-kvao-test-missing-return
  • 188fb10 Add missing return in KVAO keys test suite
  • 736a4ad Merge pull request #1218 from strongloop/clear-cache-if-delete-all-supported
  • 0b93c5c Detect deleteAll support in KVAO tests
  • b530ec2 Merge pull request #1143 from doublemarked/hm/coerce-array-like-objects-as-arrays
  • 2377792 Coerce array-like objects into arrays
  • 6f2a075 Merge pull request #1214 from strongloop/refactor/kvao-flush
  • 2320df1 Refactor flush to deleteAll
  • 1e05640 Merge pull request #1215 from strongloop/upgrade-eslint

There are 22 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

build failing

I see that the build is failing, thus not so confident about adopting. What are the reasons behind the failed build and if this will be fixed soon? Thanks!

Fails when there is a complex type in model.json

e.g:

"geometry": {
            "type": {
                "location": {
                    "lat": "number",
                    "lng": "number"
                },
                "viewport": {
                    "northeast": {
                        "lat": "number",
                        "lng": "number"
                    },
                    "southwest": {
                        "lat": "number",
                        "lng": "number"
                    }
                }
            },
            "description": "contains geometry information about the result, generally including the `location` (geocode) of the place and (optionally) the `viewport` identifying its general area of coverage."
        }

An in-range update of graphql-tools is breaking the build 🚨

Version 0.9.2 of graphql-tools just got published.

Branch Build failing 🚨
Dependency graphql-tools
Current Version 0.9.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As graphql-tools is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 13 commits .

  • 2e03eb4 Merge pull request #265 from apollostack/0.9.2
  • a16e47b 0.9.2
  • c893968 update CHANGELOG.md
  • 6dbc89a Merge pull request #264 from apollostack/greenkeeper-graphql-0.9.0
  • 7b7f290 fix linter errors
  • e596ff5 remove obsolete test
  • 17997ee Fix typo
  • c969f49 Update graphql-js dependency
  • 53b12de Merge branch 'master' into greenkeeper-graphql-0.9.0
  • 5d9172b Merge pull request #262 from rogchap/error-handling-promise
  • f9f4f0c Fix typo
  • 825f04d chore(package): update graphql to version 0.9.0
  • 3ec066e Handle logging errors if resolve fn is a Promise. fixes #254

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Error Type Image Field MSSQL

I have a model with an image type field from mssql database.
But does not recognize correctly.

"ximagen": {
"type": "Binary",
"required": false,
"length": 2147483647,
"precision": null,
"scale": null,
"mssql": {
"columnName": "ximagen",
"dataType": "image",
"dataLength": 2147483647,
"dataPrecision": null,
"dataScale": null,
"nullable": "YES"
}
}

An in-range update of @types/node is breaking the build 🚨

Version 7.0.15 of @types/node just got published.

Branch Build failing 🚨
Dependency @types/node
Current Version 7.0.14
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As @types/node is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/Tallyb/loopback-graphql/builds/227726361?utm_source=github_status&utm_medium=notification)

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of graphql is breaking the build 🚨

Version 0.9.6 of graphql just got published.

Branch Build failing 🚨
Dependency graphql
Current Version 0.9.5
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

graphql is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/Tallyb/loopback-graphql/builds/227778692?utm_source=github_status&utm_medium=notification)

Release Notes v0.9.6

New

  • It is now possible to suppress warnings about non-spec compliant names by setting the GRAPHQL_NO_NAME_WARNING environment variable. This may be useful when working with legacy schemas.
Commits

The new version differs by 6 commits0.

  • 3c0a536 0.9.6
  • bcbab0f Regenerate yarn.lock
  • 7ddd8dd Merge pull request #839 from graphql/no-name-warning
  • 04e368b Kill errant blank line
  • 163fbb4 Add tests for assertValidName
  • 423200f [RFC] Environment var to silence warning about invalid names.

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

[ Question ] remoteMethod of type GET added as mutation?

Hi,

I was wondering if there is way of making a custom remoteMethod (for example: User.getCurrentUser) of type 'GET' to be available as a 'QUERY' instead of as a 'MUTATION'.
After some research and debug If I declare my remoteMethod with accessType: 'READ' it dissapears alltogether from both Query and Mutation.

Thanks

ACL Support

Hey !

I'm very interested in your project, I myself did an implementation of graphql inside loopback about 6 month ago on loopback 2.0 version. I've had troubles dealing with ACLs. I know it's in your roadmap, but do you have any ideas on how to implement them inside loopback-graphql ?

This project looks very promising !

Apply a where filter to the related model

Hello

I am doing some test queries using your plugin over a loopback application.

I want to apply a where filter to the related model .

Does the "where" parameter of type JSON works with related model properties ?

In the below example: the second "where" filter (where: {name: "SMH"} ) on the related model is not working ..

query ListEntities($where: JSON!) {
allEntityRoles(where: $where, first: 10) {
totalCount
EntityRoles {
id
entity(where: {name: "SMH"}) {
edges {
node {
id
entCode
name
}
}
}

}

}
}

variable:
{
"where": {
"CompanyId": "aa5d2125-bcfc-4808-ae55-5aec699f3509",
"EntityRoleTypeId": "f3e03826-28cb-4d72-ad71-7b5e174dbfb9"

}
}

UpperFirst causing problem for lower case model names

Is there any reason to force using Model names starting with upper case letter?

This is causing problems when using models with lower case names.

utils.js#L50

Error Log:

.../node_modules/loopback-graphql/lib/ast.js:47
    types[modelName].fields[propertyName] = {
                    ^

TypeError: Cannot read property 'fields' of undefined
    at mapProperty (.../node_modules/loopback-graphql/lib/ast.js:47:21)
    at _.forEach (.../api/node_modules/loopback-graphql/lib/ast.js:223:13)
    at .../node_modules/lodash/lodash.js:4970:15
    at baseForOwn (.../node_modules/lodash/lodash.js:3020:24)
    at .../node_modules/lodash/lodash.js:4939:18
    at Function.forEach (./node_modules/lodash/lodash.js:9344:14)
 ..   at _.forEach.model (.../node_modules/loopback-graphql/lib/ast.js:222:11)
    at arrayEach (.../node_modules/lodash/lodash.js:537:11)
    at Function.forEach (.../node_modules/lodash/lodash.js:9344:14)
    at abstractTypes (.../node_modules/loopback-graphql/lib/ast.js:213:7)
    at module.exports (.../node_modules/loopback-graphql/lib/boot.js:14:17)
    at .../node_modules/loopback-boot/lib/executor.js:437:5
    at Array.forEach (native)
    at setupComponents (.../node_modules/loopback-boot/lib/executor.js:430:27)
    at execute (.../node_modules/loopback-boot/lib/executor.js:41:3)
    at bootLoopBackApp (.../node_modules/loopback-boot/index.js:154:3)
    at Object.<anonymous> (.../server/server.js:25:1)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)

An in-range update of apollo-client is breaking the build 🚨

Version 1.0.0-rc.3 of apollo-client just got published.

Branch Build failing 🚨
Dependency apollo-client
Current Version 1.0.0-rc.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As apollo-client is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of @types/lodash is breaking the build 🚨

Version 4.14.64 of @types/lodash just got published.

Branch Build failing 🚨
Dependency @types/lodash
Current Version 4.14.63
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As @types/lodash is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of graphql-server-express is breaking the build 🚨

Version 0.5.1 of graphql-server-express just got published.

Branch Build failing 🚨
Dependency graphql-server-express
Current Version 0.5.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As graphql-server-express is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

cannot get graphql running

so, and I am feeling really stupid here, I cannot get this to work. I have followed the instructions, and the loopback server comes up, but nothing happens when I try to access /graphiql

I have a sneaking suspicion that I also need to install some server-side graphql server ... or do I ?

getting `Error: Property name "constructor" is not allowed in "model" data` when trying to create a new model

First of all, thanks for creating this package, I'll be more than happy to help contribute, but I'm trying to get it running and I'm stuck on creating models, login and queries are fine. But not create mutations.

loopback --> 3.0.0
loopback-graphql --> 0.10.0

I have a company Model with only a name attribute.

the query I'm trying to run:

mutation {
  createcompany(data: {name: "super company"}) {
    name
  }
}
Error: Property name "constructor" is not allowed in "model" data
    at ModelConstructor.ModelBaseClass._initProperties (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/loopback-datasource-juggler/lib/model.js:77:11)
    at ModelConstructor.ModelBaseClass (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/loopback-datasource-juggler/lib/model.js:58:8)
    at ModelConstructor (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/loopback-datasource-juggler/lib/model-builder.js:185:22)
    at ModelConstructor (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/loopback-datasource-juggler/lib/model-builder.js:185:22)
    at new ModelConstructor (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/loopback-datasource-juggler/lib/model-builder.js:185:22)
    at Function.DataAccessObject.create (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/loopback-datasource-juggler/lib/dao.js:287:11)
    at Promise.denodeify (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/nodegit-promise/lib/node-extensions.js:24:20)
    at tryCallTwo (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/nodegit-promise/lib/core.js:45:5)
    at doResolve (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/nodegit-promise/lib/core.js:173:13)
    at new Promise (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/nodegit-promise/lib/core.js:65:3)
    at Function.Promise.denodeify (/Users/thabbas/Projects/code/loopback/loopback-demo/node_modules/nodegit-promise/lib/node-extensions.js:19:12)

The contents of model.js in loopback loopback-datasource-juggler at that exception:

ModelBaseClass.prototype._initProperties = function(data, options) {
  var self = this;
  var ctor = this.constructor;

  if (typeof data !== 'undefined' &&
      typeof (data.constructor) !== 'function') { // ERRORS HERE
    throw new Error(g.f('Property name "{{constructor}}" is not allowed in %s data', ctor.modelName));
  }

Which is weird, as the error states 'Property name "{{constructor}}" is not allowed in data', but in the code, it's throwing the error if the passed data doesn't have a constructor. 😅

I'm not sure if it's an issue with loobpack-graphql or loopback-datasource-juggler.

Please let me know if more explanation or help is needed

Unprototyped objects coming in from GraphQL to Loopback

I'm trying to use the "where" parameter in a query like this:

query getAllStatus {
  allVStatus(where: {name : {like: "abc%"}}) {
    VStatus {
      name
      field1
      field2
    }
  }
}

I get an error Cannot convert object to primitive value. Full stack trace:

Uncaught TypeError: Cannot convert object to primitive value
    at Object.String [as DataType] (<anonymous>)
    at eval (eval at DataAccessObject._coerce (E:\dev\pm-web\node_modules\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:1791:11), <anonymous>:1:1)
    at Function.DataAccessObject._coerce (E:\dev\pm-web\node_modules\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:1791:11)
    at Function.DataAccessObject.count (E:\dev\pm-web\node_modules\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:2431:18)
    at getCount (E:\dev\pm-web\node_modules\loopback-graphql\dist\index.js:187:18)
    at Object.findAll (E:\dev\pm-web\node_modules\loopback-graphql\dist\index.js:208:12)
    at Query._a.(anonymous function) (E:\dev\pm-web\node_modules\loopback-graphql\dist\index.js:709:34)
    at resolveOrError (E:\dev\pm-web\node_modules\graphql\execution\execute.js:474:12)
    at resolveField (E:\dev\pm-web\node_modules\graphql\execution\execute.js:460:16)
    at E:\dev\pm-web\node_modules\graphql\execution\execute.js:275:18
    at Array.reduce (<anonymous>)
    at executeFields (E:\dev\pm-web\node_modules\graphql\execution\execute.js:272:42)
    at executeOperation (E:\dev\pm-web\node_modules\graphql\execution\execute.js:212:10)
    at E:\dev\pm-web\node_modules\graphql\execution\execute.js:120:13
    at Promise (<anonymous>)
    at Object.execute (E:\dev\pm-web\node_modules\graphql\execution\execute.js:119:10)

All I've managed to find out is that the where object that reaches DataAccessObject._coerce (loopback-datasource-juggler\lib\dao.js) is an unprototyped object and the line with the statement val = DataType(val); (currently 1791) causes the exception.

I've not determined which function is called, but it belongs to the loopback model of the table. It may be ModelBuilder.prototype.resolveType but I've been unable to step into the function.

The unprototyped object probably comes from GraphQL's values.js function getVariableValues (instantiates stuff with Object.create(null)).

Note: I'm using the GraphiQL interface to test all this. It is worth noting that using a variable works much better:

query getAllStatus($where: JSON!) {
  allVStatus(where: $where) {
...

and the variable is declared with {"where": {"name": {"like": "abc%"}}}

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Problem running . node graphql/utilities/buildASTSchema.js:266

I installed via NPM and added this to my component-config.json but get the following error

{
"loopback-component-explorer": {
"mountPath": "/explorer"
},
"loopback-graphql": {
"path": "/graphql",
"graphiqlPath":"/graphiql"
}
}

node_modules/graphql/utilities/buildASTSchema.js:266
throw new Error('Type "' + typeName + '" not found in document.');
^

Error: Type "undefined" not found in document.

[Question] How do I log in?

Hi!

great project! I am using Apollo server in my project and I was just about to map out the API for sessions / login when I saw your project.

When I look in Graphiql there are the methods saveUser and deleteUser. There's no mutation for all the other types/things.

When I query for BlogPosts (hasMany BlogComment) I can't get the comments out. This is where I'm doing it manually; https://gist.github.com/Industrial/5342b9dbc41ecc601c9996c4eb28d8a6

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.